| | |
Here Is Another Way I Wrote This Program Which Is Due
Thread Solved |
•
•
Join Date: Feb 2006
Posts: 43
Reputation:
Solved Threads: 0
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
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
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
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
![]() |
Similar Threads
- Square root program without sqrt or pwr (C++)
- Chatting Program - Throws IO Exception (Java)
- What's the HARDEST program you've written? (Computer Science)
- Dice program (C)
- Help! Cannot get program running due to CD not detected!? (Windows NT / 2000 / XP)
- Please help fix this lexer program (C++)
- My computer is Closing itself. (Windows NT / 2000 / XP)
- Glass Pane (Java)
Other Threads in the Python Forum
| Thread Tools | Search this Thread |
advanced aliased bash beginner bits calling casino changecolor clear command convert corners count csv cturtle cursor def definedlines dictionary digital dynamic dynamically event events examples external file float format frange function google gui hints homework i/o iframe import input jaunty java keyboard line linux list lists loop matching mouse multiple number numbers obexftp output parsing path port prime programming projects py py2exe pygame pygtk python random rational raw_input recursion return scrolledtext signal singleton skinning stderr string strings subprocess table tails terminal text thread threading time tkinter tlapse tuple tutorial ubuntu unicode urllib urllib2 valueerror variable voip web-scrape whileloop word wxpython






