943,946 Members | Top Members by Rank

Ad:
  • Python Discussion Thread
  • Marked Solved
  • Views: 1085
  • Python RSS
Apr 20th, 2006
0

Its Running, But The Numbers Isn't Lining Up Straight.please Help

Expand Post »
THE WINDCHILL TABLE IS RUNNING, BUT THE NUMBER IS NOT LINNING UP STRAIGHT. CAN YOU PLEASE HELP ME, THANKS


Python Syntax (Toggle Plain Text)
  1. def windchill( vel, temp):
  2. wc = 35.74 + .6215*temp - 35.75*(vel**.16) + .4275*temp*(vel**.16)
  3. return wc
  4.  
  5.  
  6. def main():
  7. print (" __ __ __ Temperature \n")
  8. print ("Speed \n")
  9. print (" 1 -20 70 10 0 10 20 30 40 50 60 ")
  10.  
  11.  
  12.  
  13.  
  14. for x in range(5, 55, 5):
  15. print x
  16. for y in range (-20, 70, 10):
  17. chill = windchill(x,y)
  18. print str(int(chill)) + " ",
  19.  
  20.  
  21.  
  22.  
  23. main()

:mad: :evil: :cry: :o
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
butterflyTee is offline Offline
43 posts
since Feb 2006
Apr 21st, 2006
0

Re: Its Running, But The Numbers Isn't Lining Up Straight.please Help

Quote ...

print str(int(chill)) + " ",
you can try this statement instead :

print "%3s" % str(int(chill)) + " ",
Reputation Points: 10
Solved Threads: 0
Newbie Poster
greatbear is offline Offline
3 posts
since Apr 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Python Forum Timeline: Python speed !
Next Thread in Python Forum Timeline: program to read print who you are, based on your user account in/etc/passwd.





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC