String Functions
There are two things you can do to a string to get certain pieces of information from it.
Get String Length:
len()
This gets you the length of the variable that you enter into the brackets. The variable has to be a string.
Print A Specific Spot In A String
Using [] brackets, you can get a specific letter at a specific spot in a string.
Example: print answer[5]
This prints the 6th physical spot in a string because spot [0] is the first spot!
Try the program below and note the use of len and printing positions in a string
Assignment #11
Using len() and [ ] to print specific spots in a string, make a program that produces the following output.
Bonus: complete in under 6 lines including your name