I need a lesson.

Brett g Porter BgPorter at NOacmSPAM.org
Wed Jun 7 20:22:48 EDT 2000


"F. G. Brown" <fgbrown at ionet.net> wrote in message
news:8hmn80$4vu$1 at ionews.ionet.net...
> Greetings,
> ?????????????????????????????????????????????
>
> howfast.py
while 1:    # this will make your code loop...forever (see note [1] below)
    # Do yourself (and anyone who'll ever read your code)
    # and get in the habit /now/ of using meaningful variable names.
   distance = raw_input("What is the distance you traveled in miles?  ")
   time = raw_input("How many seconds did it require?  ")
   speed = (int(distance) * 3600.00) / int(time)
   print "You were going %d mph!" % speed
   if speed > 75:
      print "Hey you better slow down!"
   loopAgain = raw_input ("Would you like to do another? (y)es or (n)o")
   if loopAgain == 'y':
      print 'Here we go!'
   else:
      print 'See ya!'
      break    ## note [1] -- this gets you out of the loop!








More information about the Python-list mailing list