Question: Please write down the code in the placeholders for PyCharm # Replace the placeholders and run the Python program import random nameinput(Please enter your name:
Please write down the code in the placeholders for PyCharm
# Replace the placeholders and run the Python program import random nameinput("Please enter your name: ") In this program, we will write code that has one loop and does different computations each time through the loop depending on the value of the loop variable for x in range (20): statement here The program should input a name from the keyboard and then print out the name every third time through the loop f expression here: print(name) if expression here: The program should print a random integer between 1 and 10 every other time through the loop print (random.randint (1,10)) t should also print out the string "test" and the loop variable every time through the loop. The loop should run 20 times. [Hint: use the modulo operator %]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
