0
How to make a loop to this code that asks the user if they want to do it again?
n=int(input("enter no. of times::")) print ("eggs"*n)
3 Antworten
+ 1
Playagain = "Y"
while Playagain != "N":
n=int(input("\n\nenter no. of times:"))
print ("eggs"*n)
Playagain = (input("\nWould you like to Continue? (Y|N)"))
+ 1
while True:
try:
n = input()
print "eggs" * n
except EOFError:
break
I didn't write your whole code, you can do it
+ 1
This could work. I'm not 100 % sure since I'm just started learning.
While x=y:
--your code - -
Print("repeat? ")
x=input (" y or n")