+ 1
How to make this work?
1. Write a program that asks the user for their name and how many times to print it. The program should print out the userâs name the specified number of times. This is my codes so far; name=int(input("Type name ")) num = int(input("How many times would you like to print the name? ")) a = name b = num for i in range(num): print(b) temp = a a = b b = temp + b
2 Answers
+ 6
int(input()) expects an integer, using it to get a name which is a string will result in ValueError.
change it to:
name = input ("type name" )
this loop is enough to do the job .
for i in range(num):
print(name)
+ 3
thankyouuuuu Bahha