I need a lesson - howfast.py Revisited

F. G. Brown fgbrown at ionet.net
Fri Jun 9 18:06:24 EDT 2000


Greetings!
First off I want to thank everyone for their responses to my post a few days
back (2000 06 07).  I was able to learn much from all of your suggestions.
At the same time I can see that it's going to take alot of effort on my
part, to be proficient in using Python, so you might be hearing from me now
and then when I hit a wall.  If anyone has a suggested challenge for me to
work on next, I'll give it a try.
Thanks again, Bjorn, Brent, Scott, David, Brett, & Moshe.
Regards,
Fred

Below is what I finally came up with using everyone suggestions.
I next am going to see if I can make it an executable file in a DOS
and Windows environment.  I seem to remember reading that I
can download a program for doing that somewhere.
Time to go hunting!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!

howfast.py

decide = 'y'
while decide == 'y':
     distance = input("What is the distance you traveled in miles?  ")
     time = input("How many seconds did it require?  ")
     speed = distance*3600.00/time
          print "You were going %d mph!" %speed
     if speed > 75:
          print "Hey you better slow down!"
     decide = raw_input ("Would you like to do another? (y)es or (n)o")
     if decide == "y":
          print 'Here we go!'
else:
          print 'See ya!'






More information about the Python-list mailing list