+ 1
Input in a while loop?
how do I make it possible to let the user of my programm put in a number multiple times (loop) in the python playground?
5 Answers
+ 1
I dont think it is possible.maybe it just doesnt work on it due to some limitation of the python playground.
im not sure whether there is any solution or not,but according to my experience,i dont think so.
+ 1
It depends on what you want to achieve?
You can put user_input = input(":") in a while statement. The below will continue looping until quit is typed
While true:
User_input = input(":")
Print ("options")
Print ("one argument")
Print ("quit")
Print ("add")
If user_input == "your argument":
Put in here what you want the function to do
Elif user_input == "quit":
Break
Elif user_input == "add":
Num1 = float(input("enter number"))
Num2 = float(input("enter another:"))
Result = str(num1 + num2)
Print ("the result is " + result)
Else:
Print ("unknown input")
0
well thanks for ur response anyways :)
0
sorry bro.it seems that i dont make any contribution,but maybe there is still some hope as long as we keep waiting for the real master to solve your problem.Good luck.
0
thanks alot @Paul Bartholomew :)