Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

Use python3 to write a code Write a program that reads the rainfall.txt then write out a new file called rainfallfmt.txt. The data should be

Use python3 to write a code Write a program that reads the rainfall.txt then write out a new file called rainfallfmt.txt. The data should be grouped on the normal annual rainfall field into the following categories: [51-60], [61-70], [71-80], [81-90], [91-100]. Under each category, the new file should format each line so that the city name is in upper case letters and is centered in a field that is 25 characters wide, and the rainfall data should be printed in a field that is 5 characters wide with 1 digit to the right of the decimal point

The file is rainfall.txt

Akron 65.5574 Albia 95.631 Algona 77.9526 Allison 85.4456 Alton 69.6722 AmesW 86.5378 AmesSE 86.233 Anamosa 89.7382 Ankeny 84.7852 Atlantic 88.3158 Audubon 84.8614 Beaconsfield 89.5858 Bedford 92.329 BellePlaine 90.9574 Bellevue 87.249 Blockton 92.1512 Bloomfield 96.5708 Boone 92.202 Brighton 85.3186 Britt 80.1116 Buckeye 85.4964 BurlingtonKBUR 96.3676 Burlington 93.8276 Carroll 84.6582 Cascade 85.0392

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

101 Database Exercises Text Workbook

Authors: McGraw-Hill

2nd Edition

0028007484, 978-0028007489

More Books

Students explore these related Databases questions

Question

Solve for the missing amounts

Answered: 3 weeks ago