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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!