944,028 Members | Top Members by Rank

Ad:
  • Python Discussion Thread
  • Marked Solved
  • Views: 1113
  • Python RSS
Apr 19th, 2006
0

Here Is Another Way I Wrote This Program Which Is Due

Expand Post »
def windchill(temp, vel):
wc = 35.74 + .6215*temp - (35.75*vel**.16 + .4275*temp*vel**.16)
return wc



def main():
print (" __ __ __Temp /n")
print (" Speed /n")
print ("-20 70 10 0 10 20 30 40 50 60 ")



for x in range (5,55,5):
print x
for y in range (-20,70,10):
chill =windchill(x,y)
print chill + " "




main()

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

Re: Here Is Another Way I Wrote This Program Which Is Due

Once more, please put your code into code tags to show the right indentation, see:
http://www.daniweb.com/techtalkforum...ment114-3.html

Most people will not read any of your code unless you do that!

Your first program worked just fine, why did you change it?

This program will give you error, because you are giving it negative windspeeds! Use more meaningful variable names, t and v rather than x and y and you discover your mistakes!

Also newline is \n
Reputation Points: 404
Solved Threads: 180
Nearly a Posting Virtuoso
bumsfeld is offline Offline
1,422 posts
since Jul 2005

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:





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


Follow us on Twitter


© 2011 DaniWeb® LLC