Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PHYTON example. The file hwll Meteo.txt contains the temperatures measured in Istanbul, Ankara and Izmir once every hour in April. The data may not be

PHYTON image text in transcribed
image text in transcribedexample.
The file hwll Meteo.txt contains the temperatures measured in Istanbul, Ankara and Izmir once every hour in April. The data may not be in a strict order of cities. As temperature values were transferred to the database computer over the Internet, some hourly values may also have been lost during transmission. Write a Python program that will do the following (do NOT use lists or dictionaries): 1. Place the data of each city into a separate file of its own. The files should be called istanbul.txt, ankara.txt and izmir.txt 2. Write a function that gets a city name (such as izmir") as a parameter from its caller. The function should then read the data from the file of the city (such as "izmir.txt") and find the minimum, maximum and average temperatures for each day of the month. These daily min/max and average temperatures should then be written to a file whose name is the city name followed by "minmax.txt" (such as "izmirminmax.txt'). The averages should be evaluated over the existing values (i.e., divided into 23 if any temperature is missing) and written with one decimal place; minimums and maximums should not have decimal places. 3. Call the function for each one of the three cities to create the files named istanbulminmax.txt, ankaraminmax.txt, izmirminmax.txt. Individual city raw data files (istanbul.txt, ankara.txt, izmir.txt) should be laid out exactly as follows: 7 7 01.04.2020 00:00 01.04.2020 01:00 01.04.2020 02:00 01.04.2020 03:00 01.04.2020 04:00 01.04.2020 05:00 9 9 10 Individual city summary files (istanbulminmax.txt, ankaraminmax.txt, izmirminmax.txt) should be laid out exactly as follows: 13 11 8 10.5 9.0 7.3 01.04.2020 2 02.04.2020 7 03.04.2020 5 (some lines skipped 29.04.2020 15 30.04.2020 14 19 18 17.6 16.9 Istanbul 01.04.2020 10:00 13 Izmir 01.04.2020 10:00 14 Ankara 01.04.2020 10:00 13 Ankara 01.04.2020 11:00 13 Izmir 01.04.2020 11:00 14 Istanbul 01.04.2020 11:00 13 Izmir 01.04.2020 12:00 14 Ankara 01.04.2020 12:00 13 Istanbul 01.04.2020 12:00 13 Istanbul 01.04.2020 13:00 13 Izmir 01.04.2020 13:00 14 Ankara 01.04.2020 13:00 13 Ankara 01.04.2020 14:00 13 Istanbul 01.04.2020 14:00 13 Izmir 01.04.2020 14:00 14 Istanbul 01.04.2020 15:00 13 Izmir 01.04.2020 15:00 14 Ankara 01.04.2020 15:00 13 Izmir 01.04.2020 16:00 13 Ankara 01.04.2020 16:00 13 Istanbul 01.04.2020 16:00 13 Ankara 01.04.2020 17:00 13 Istanbul 01.04.2020 17:00 13 Izmir 01.04.2020 17:00 13 Izmir 01.04.2020 18:00 13 Ankara 01.04.2020 18:00 12 Istanbul 01.04.2020 18:00 13 Istanbul 01.04.2020 19:00 13 Ankara 01.04.2020 19:00 11 Izmir 01.04.2020 19:00 12 Izmir 01.04.2020 20:00 12 Istanbul 01.04.2020 20:00 12 Ankara 01.04.2020 20:00 10 Izmir 01.04.2020 21:00 12 Istanbul 01.04.2020 21:00 12 Ankara 01.04.2020 21:00 Izmir 01.04.2020 22:00 11 Istanbul 01.04.2020 22:00 12 Ankara 01.04.2020 22:00 8 Ankara 01.04.2020 23:00 Istanbul 7

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

Step: 3

blur-text-image

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

Distributed Relational Database Architecture Connectivity Guide

Authors: Teresa Hopper

4th Edition

0133983064, 978-0133983067

More Books

Students also viewed these Databases questions