Thanks for the enthusiasm on how input/raw_input() works - my original
intention was to ask a question on control flow so I didn't spend that
much time testing out this piece of input code besides typing. But I did
learn a lot. Thanks!
Gilbert
Jacob S. wrote:
I noticed that too, Liam.
b =
Gilbert Tsang wrote:
Hi there, I have this logic that I cannot wrap my mind it:
def go_jogging():
# go out and jog
return
if ( bad_weather =='y' ):
# ask user only if weather is bad.
b = input ( Weather is really bad, still go out to jog?[y/n] )
if b == 'y':
go_jogging()
Gilbert Tsang wrote:
Hi there, I have this logic that I cannot wrap my mind it:
def go_jogging():
# go out and jog
return
if ( bad_weather =='y' ):
# ask user only if weather is bad.
b = input ( Weather is really bad, still go out to jog?[y/n] )
if b == 'y':
go_jogging()
SEveral solutions here.
The best is to restructure the code a little:
def go_jogging():
# go out and jog
return
if not bad_weather == 'y': # where is this initially set BTW?
go_jogging()
else
# ask user only if weather is bad.
b = input ( Weather is really bad,