Question
Write a single script including these two parts String methods Ask the user for a name (test with George Washington). Print the name in all
Write a single script including these two parts
String methods
Ask the user for a name (test with George Washington).
Print the name in all uppercase letters.
Print the length of the name.
Print the 4th character of the name (r).
Create a variable called name2. Assign to name2 the name with all "o" characters replaced with "x"s.
Print name2.
Print the original name.
Counting and Finding
Assign the text "Believe you can and you're halfway there." to a variable called quote (this is a quote from Theodore Roosevelt).
Count how many "a" characters there are, print the result.
Print the index of all the "a" characters. Hint: Except for the first find, set the start location for the next find as the previous location found index + 1. The second argument in the find method is the index where the find starts looking. A fuller explanation of the find method is given in string-methods
PYTHON
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started