CIS 41A Unit B, Exercise B

Write a single script that includes these two parts

At the top of your script, put the following multi-line comment with your information:

'''
Your name as registered, with optional nickname in parentheses
CIS 41A   Fall 2021
Unit B, Exercise B
'''

1) String methods

  1. Ask the user for a name (test with George Washington).
  2. Print the name in all uppercase letters.
  3. Print the length of the name.
  4. Print the 4th character of the name (r).
  5. Create a variable called name2. Assign to name2 the name with all "o" characters replaced with "x"s.
  6. Print name2.
  7. Print the original name.

2) Counting and Finding

  1. Assign the text "Believe you can and you're halfway there." to a variable called quote (this is a quote from Theodore Roosevelt).
  2. Count how many "a" characters there are, print the result.
  3. 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

Example output:

Enter the name: George Washington
GEORGE WASHINGTON
17
r
Gexrge Washingtxn
George Washington
Count =  4
a found at  13
a found at  16
a found at  28
a found at  32

Add the following at the end of the script to show your results:

'''
Execution results:
paste execution results here
'''

Submit your finished py script in Canvas, Exercise B.