Question
Need to use Python string formatting to align wind-chill values in equal-sized columns
Using your knowledge of loops and other Python features covered so far, write a program that prints a table of windchill values, where: Rows represent wind speed for O to 50 in 5 mph increments Columns represent temperatures from -20 to +60 in 10-degree increments Your program should include a function that returns windchill for a given combination of wind speed & temperature, using this formula from the National Weather Service: 35.74 + 0.6215 x T-35.75 x V0.16 + 0.4275 x T x V0.16 Where T-temperature in Fahrenheit and V-wind speed in mph. You should avoid hard-coding individual values of windspeed & temperature. Be sure to check your program output against this NWS chart https://www.weather.gov/safety/cold-wind-chill-charte Hint: the formula only applies for wind speeds> 3 mph Test your wind-chill function with hard-coded values for T&V before attempting output for multiple values, Use a hard-coded value for either T or V, while varying the other input, to calculate wind-chill before attempting to vary both inputs Consider how you might use a Python range to represent multiple wind-speed or temperature values, Dont worry about matching the exact format of the NWS table or making it pretty. Your output can look something like this, where first column is wind speed and first row is temperature, and NN is the correct windchill value for that cell -20 -10 0 10 20 30 40 50 60
media%2Fe59%2Fe59f0655-1441-48a2-9204-85
0 0
Add a comment Improve this question Transcribed image text
Answer #1

If you have any doubts, please give me comment...

| 3 for t in range(-20, 61, 10): print( %5c % , end-) 4 print(%5dt, end-) 5 print) 6 print(-#60) 7 for v in range (0, 51, 5): 8 print( %5d ! Zv, end-) for t in range(-20, 61, 10): 10 r 35.74+0.6215*t-35.75*v*0.16+0.4275*t*v**0.16 print(%5dr, end-) 12 print() PROBLEMS 38 OUTPUT DEBUG CONSOLE TERMINAL 1: bash nagarajuanagaraju-Vostro-3550:~/Desktop/CHEGG/October/17102018$ python3 windchill.py I -20 -10 0 10 20 30 40 50 60 0 23 29 35 41 48 54 60 66 73 5 34 -22 -10 1 12 24 36 48 59 10 40 -28 -15 3 8 21 33 46 58 15 -45 -32 -19 -6 6 19 31 44 57 20 48 -35 -21 -8 417 30 4356 25 50 -37 -24 -10 2 16 29 42 56 30 53 -39 -25 -12 1 14 28 4255 35 -54 -41 -27 -13 13 27 41 55 40 I -56 -42 -28 -14 0 13 26 4054 45 -58 -44 -29 -15 -1 12 26 4054 50 -59 -45-31 -16 -2 11 25 39 54

Add a comment
Know the answer?
Add Answer to:
Need to use Python string formatting to align wind-chill values in equal-sized columns Using your knowledge...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Part​ ​A Write a function windChillCalculator ​to determine the wind chill. Your main function should take...

    Part​ ​A Write a function windChillCalculator ​to determine the wind chill. Your main function should take in user inputs for T (air temperature) and V (wind speed) and pass these values as parameters to your function. After your function calculates the wind chill it should return​ it to main. To test your code, for T = 30.0 and V = 5.0, you should get a Wind Chill of 24.7268. Within your main function, print the following cout statement: cout <<...

  • Please see the articles below… 1.  What is your opinion on the subject? 2.  Which ethical views (i.e.,...

    Please see the articles below… 1.  What is your opinion on the subject? 2.  Which ethical views (i.e., utilitarian view, moral rights view, justice view, practical view) you feel are being used by both sides of the argument (i.e., for and against downloading) to justify their positions? High Court Enters File-Sharing Spat; Justices Must Determine Software Providers' Liability For Copyright Violations by Anne Marie Squeo. Wall Street Journal. (Eastern edition). New York, N.Y.: Mar 30, 2005. pg. A.2 WASHINGTON -- The Supreme...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT