Skip to content

Instantly share code, notes, and snippets.

@spaghettiSyntax
Created December 6, 2017 08:18
Show Gist options
  • Save spaghettiSyntax/2aabce41e0dbb82328d4e0c3fb790070 to your computer and use it in GitHub Desktop.
Save spaghettiSyntax/2aabce41e0dbb82328d4e0c3fb790070 to your computer and use it in GitHub Desktop.
Tony Gaddis Python: Wind Chill Table
# 11/13/17
# Wind chill values. Rows should represent windspeed from 10 to
# 60 mph inclusive in 5 mph increments. Columns should
# represent temperatures from -20 to 60 inclusive in
# 10-degree increments.
# Print x values of table.
print()
print('Wind Chill Table')
print('\tTemperature')
print(' ', end = '')
for temp in range(-20, 61, 10):
print(format(temp, '8d'), end = '')
print()
# Print y values of table.
print('Speed ', end = '')
for temp in range(-20, 61, 10):
print('_______', end = '')
print('_________')
# Print calculations inside table.
for speed in range(10, 61, 5):
print(speed, '|', end = ' ')
for temp in range(-20, 61, 10):
wind_chill = 35.74 + 0.6215 * temp \
- speed ** 0.16 * (35.75 \
- 0.4275 * temp)
print(format(wind_chill, '6.2f'), end = ' ')
print()
@samueltegegn
Copy link

what is this"for temp in range(-20, 61, 10):"

@spaghettiSyntax
Copy link
Author

range (start, stop[, step])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment