| | |
Did I do the windchill index correctly.Due in 18hrs.Is there other ways to write this
Thread Solved |
•
•
Join Date: Feb 2006
Posts: 43
Reputation:
Solved Threads: 0
Did I do the windchill index correctly.Due in 18hrs.Is there other ways to write this
0
#1 Apr 17th, 2006
Python Syntax (Toggle Plain Text)
# windchill.py # tpm # A program that prints a nicely formatted table of windchill values. from math import * def windchill(t, v): c = 35.74 + (0.6215 * t) - (35.75 * v ** .16) + (.4275 * t * v ** .16) return c def main(): print "MPH:", for k in range (-20, 70, 10): print "%3d" %k, print "_" * 44 for velocity in range (5, 55, 5): print "%3d" %velocity, for temp in range (-20, 70, 10): chill = windchill(temp, velocity) print "%3d" %round(chill), main()
Last edited by alc6379; Apr 17th, 2006 at 9:01 pm.
Re: Did I do the windchill index correctly.Due in 18hrs.Is there other ways to write
0
#2 Apr 17th, 2006
Assuming the formula is right, looks basically fine to me. Just be sure to remove the spaces from the main() subroutine you call at the end, there. Good Job!
A handy tip:
Be sure to place [code][/code] tags around your code. It's especially important with Python, because the spaces actually are part of the code structure.
A handy tip:
Be sure to place [code][/code] tags around your code. It's especially important with Python, because the spaces actually are part of the code structure.
Alex Cavnar, aka alc6379
•
•
Join Date: Feb 2006
Posts: 43
Reputation:
Solved Threads: 0
Re: Did I do the windchill index correctly.Due in 18hrs.Is there other ways to write
0
#3 Apr 18th, 2006
•
•
Join Date: Feb 2006
Posts: 43
Reputation:
Solved Threads: 0
Re: Did I do the windchill index correctly.Due in 18hrs.Is there other ways to write this
0
#4 Apr 19th, 2006
Re: Did I do the windchill index correctly.Due in 18hrs.Is there other ways to write
0
#5 Apr 19th, 2006
![]() |
Similar Threads
- Did I do this correctly..Due in 11hrs..Can this program be written in other ways? (Python)
- New 2 C++, help with finding erros (C++)
- loads htm but not aspx (ASP.NET)
Other Threads in the Python Forum
- Previous Thread: Here Is Another Way I Wrote This Program Which Is Due
- Next Thread: Printing
| Thread Tools | Search this Thread |
address anydbm app bash beginner bits changecolor cipher clear conversion coordinates corners cturtle curves definedlines development dictionary dynamic events examples excel external feet file float format function generator getvalue gui handling homework iframe images import input ip java keycontrol line linux list lists loan loop maintain matching maze millimeter mouse number numbers output parsing path port prime programming projects py2exe pygame pymailer python queue random rational raw_input recursion recursive scrolledtext searchingfile singleton slicenotation split string strings tails terminal text threading time tlapse tooltip tuple tutorial type ubuntu unicode url urllib urllib2 valueerror variable variables vigenere web whileloop word wxpython xlwt






