View the step-by-step solution to:

Write a Python program that will read a list of temperatures from a data file you created called tempfile.txt and display the highest two...

Write a Python program that will read a list of temperatures from a data file you created called tempfile.txt and display the highest two temperatures. For example
Your program displays:
The highest two temperatures found are 89 and 70
When tempfile.txt contains
32
15
65
89
44
59
70

Hint: First read the temperatures into a list, and then loop through the llst looking for the two largest values without using built-in functions such as max or sort. then rewrite the program using the built-in function sort, and finally ,rewrit it the thir time using the built-in function max.


Sign up to view the entire interaction

Top Answer

Please have the tempfile.txt which has... View the full answer

tempfile.txt

32 15 65 89 44 59 70

Sign up to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask a homework question - tutors are online