in python please 1) 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. 2) 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 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 '''
Addition of Two Numbers
Adding two numbers in programming is essentially the same as adding two numbers in general arithmetic. A significant difference is that in programming, you need to pay attention to the data type of the variable that will hold the sum of two numbers.
C++
C++ is a general-purpose hybrid language, which supports both OOPs and procedural language designed and developed by Bjarne Stroustrup. It began in 1979 as “C with Classes” at Bell Labs and first appeared in the year 1985 as C++. It is the superset of C programming language, because it uses most of the C code syntax. Due to its hybrid functionality, it used to develop embedded systems, operating systems, web browser, GUI and video games.
in python please
1) 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.
2) 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
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
'''
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images