The Artima Developer Community
Sponsored Link

Python Answers Forum
Python while loop

1 reply on 1 page. Most recent reply: Oct 30, 2004 7:49 AM by Bert

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Bert

Posts: 2
Nickname: bmac4444
Registered: Oct, 2004

Python while loop Posted: Oct 29, 2004 7:36 PM
Reply to this message Reply
Advertisement
I have a project due and cannot get the while loop to run correctly. Any help would be appreciated. I am not a programmer yet and dont even know Python, our class is supposed to learn it on the fly? Her is some of the code, any help would be appreciated. The loop never prints or stops?

Height = input("Enter the height the golf ball is dropped fromin feet:")
while Height <= 0:
print"cannot compute for a negative number"
Height = input("Enter the height the golf ball is dropped fromin feet:")


print"""
What surface was the golfball dropped on. Choose from the list:
1) concrete
2) wood
3) rug
"""
surface = raw_input("Enter the surface type [1,2,3]:")
count = 0
H = Height
TH = .083
print count
if surface == '1':
while H >= TH:
count = count + 1
H = Height * .85


Bert

Posts: 2
Nickname: bmac4444
Registered: Oct, 2004

Re: Python while loop Posted: Oct 30, 2004 7:49 AM
Reply to this message Reply
IT worked out just in case any one sees this thanks anyway.
Bert

Flat View: This topic has 1 reply on 1 page
Topic: coursework Previous Topic   Next Topic Topic: PYTHON JOB IN LONDON

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use