Question

modify this code to ask the user to enter their name five times name = input("what...

modify this code to ask the user to enter their name five times

name = input("what is your name?")
for i in range(5):
print(name)

0 0
Add a comment Improve this question Transcribed image text
Answer #1


for i in range(5):
    name = input("what is your name?")
    print(name)
Add a comment
Know the answer?
Add Answer to:
modify this code to ask the user to enter their name five times name = input("what...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Ask the user to enter a message Ask the user how many time they want to...

    Ask the user to enter a message Ask the user how many time they want to print the message Then use "while","do-while" and "for" loop to print the message. Show the number at the beginning of the lines when printing. For example: Enter your message: Welcome to Java How many time you want to print this message: 3 Using "while" loop: 1=> Welcome to Java 2=> Welcome to Java 3=> Welcome to Java Using "do-while" loop: 1=> Welcome to Java...

  • Write Java code that does the following Ask the user to enter a file name. Ask...

    Write Java code that does the following Ask the user to enter a file name. Ask the user for two integers as the lower bound and the upper bound. Use a loop to write all the odd numbers between the lower bound and the upper bound (inclusive) to the file, and then close the file. Use either while loop, do while loop, or for loop to complete the program. PrintWriter class is used. The file is closed before the program...

  • Write a program that would ask the user to enter an input file name, and an...

    Write a program that would ask the user to enter an input file name, and an output file name. Then the program reads the content of the input file, and read the data in each line as a number (double). These numbers represent the temperatures degrees in Fahrenheit for each day. The program should convert the temperature degrees to Celsius and then writes the numbers to the output file, with the number of day added to the beginning of the...

  • Write a C code using switch statement that will ask the user to enter a character....

    Write a C code using switch statement that will ask the user to enter a character. This character should be one of the first three characters of your name. The code then should check for the value of the character and output the following: If the character is the same as yo&r first letter then output "X=10" If the character is the same as your second letter then output "Y=5" If the character is the same as your Third letter...

  • wrote the code in the discbribtion bar Question 26 CLOS Following code is supposed to ask...

    wrote the code in the discbribtion bar Question 26 CLOS Following code is supposed to ask a user to input a numbe then print the numbers from 0 1 4 0 16 (n-1)2 def my_print(inp) for i in range(inp printi"2) n= int(input(Enter a number: ) my_print(n) The code is not working due to incorect format select the comectly formatted code def my_print(inp): for i in range(inp) printi2) n= int(input(Enter a number ) my_print(n) O def my_print(inp): for i in range(inp)...

  • JAVA Ask the user for integers. If the user did not enter an integer, ask again....

    JAVA Ask the user for integers. If the user did not enter an integer, ask again. (Type Safe Input) Keep a running total of the intergers entered (sum). Once the user enters 0, stop looping. Print the sum of all the numbers. Do not use try-catch. EXAMPLE OUTPUT: Enter an integer, 0 to stop> [fasdfsa] Invalid input. Enter an integer, 0 to stop> [231.342] Invalid input. Enter an integer, 0 to stop> [1] Enter an integer, 0 to stop> [2]...

  • Write a java program that will print if n numbers that the user will input are...

    Write a java program that will print if n numbers that the user will input are or not within a range of numbers. For that, your program needs to ask first for an integer number called N that will represent the number of times that will ask for other integer numbers. Right after, it should ask for two numbers that will represent the Min and Max for a range. Lastly. it will iterate N number times asking for an integer...

  • For Java Keyboard Input Lab3 Ask the user for their name. Then display their name to...

    For Java Keyboard Input Lab3 Ask the user for their name. Then display their name to prove that you can recall it. Ask them for their age. Then display that. Finally, ask them for how much they make and display that. You should use the most appropriate data type for each variable. Hello. What is your name? Dennis Hi, Dennis! How old are you? 37 So you're 37, eh? That's not old at all! How much do you make, Dennis?...

  • write the c++ code that keeps prompting (10 times) the user to enter an integer. the...

    write the c++ code that keeps prompting (10 times) the user to enter an integer. the code print out the product of all the the integers.

  • For this lab, modify the python code below so it will continuously be asking user for...

    For this lab, modify the python code below so it will continuously be asking user for inputs to calculate the interest earned until the user enters number 0 (zero) in principle. Once the user enters any number less or equal to 0 in principle, the program will end. here is my code: # Programming Exercise 3-14 # Local variables p = 0.0 r = 0.0 n = 0.0 t = 0.0 loop = True while loop: p = float(input('\nEnter the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT