asked 10.8k views
4 votes
Write a Python code for this scenario

Ask the user to enter a sentence. Tell them how many characters are in that sentence (len(variable_name) will do this). Ask them to enter a starting number and an ending number and display all the characters between those two characters.

1 Answer

4 votes

Answer:

Step-by-step explanation:

The function len() is one of Python’s built-in functions. It returns the length of an object. For example, it can return the number of items in a list. You can use the function with many different data types. However, not all data types are valid arguments for len().

answered
User Miroslav Popov
by
8.2k points