function - Python: Loop isn't waiting for user's input -
normally when input user, python waits until press enter key. in script reason python isn't waiting input , keeps printing text...
user_option()
, has few print statements in it...
if tell me how make wait until user enters input appreciated.
code:
while true: user_option() decision = input("what coarse of action should take?") decision = decision.strip().lower() if decision == "a": rehydration() elif decision == "b": moderate_speed() elif decision == "c": fast_speed() elif decision == "d": rest()
i'm running python 3.4.
problem in input method. in python 3.x raw_input()
not exits , input()
exits. in older version input()
, raw_input()
exits. according python version use proper method. see more here.
in python 3.x can simulate raw_input()
using eval(input())
Comments
Post a Comment