Question: Please write the solution to each question clearly 1. Write a program that prompt the user to enter a string. The program should then print
1. Write a program that prompt the user to enter a string. The program should then print the following: a) The total number of characters in the string. b) Printing the string 10 times. c) The first character of the string. d) The first three characters of the string. e) The last three characters of the string. f) Printing the string backwards. 8) The second character of the string if the string is long enough. h) The string with its first and last characters removed. 2. Write a program that generates a random number, x between 1 and 50, a random number y between 2 and 5, and computes x'. 3. Write a program that asks the user to enter two numbers, x and y. The program then should convert x to hexadecimal and y to octal and print the two results. 4. Write a program that asks the user for a number and prints out the factorial of that number. 5. Write a program that asks the user for a number of seconds and prints out how many minutes and seconds that is. For instance, 200 seconds is 3 minutes and 20 seconds. (Hint: Use the // operator to get minutes and the % operator to get seconds.) 6. Will the following lines of code print the same thing? Explain why or why not. *=6 print(6) print(x) print("6") print("x")
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
