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

Thread Solved

Join Date: Feb 2006
Posts: 43
Reputation: butterflyTee is an unknown quantity at this point 
Solved Threads: 0
butterflyTee butterflyTee is offline Offline
Light Poster

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

 
0
  #1
Apr 20th, 2006
THE WINDCHILL TABLE IS RUNNING, BUT THE NUMBER IS NOT LINNING UP STRAIGHT. CAN YOU PLEASE HELP ME, THANKS


  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
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 3
Reputation: greatbear is an unknown quantity at this point 
Solved Threads: 0
greatbear greatbear is offline Offline
Newbie Poster

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

 
0
  #2
Apr 21st, 2006

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

print "%3s" % str(int(chill)) + " ",
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC