Answer:
#section 1
def maxTemp(filename):
import pathlib
f = pathlib.Path(filename)
f.exists()
if f.exists():
f = open(filename, "r")
#section 2
next(f)
res = [int(sub.split(',')[1]) for sub in f]
maxdata = (res[0])
for i in range(len(res)-1):
if maxdata < res[i]:
maxdata = res[i]
index = res.index(maxdata)
f.close()
#section 3
li = []
a = open(filename, "r")
for line in a:
line = line.strip()
li.append(line)
a.close()
return (li[index+1])
else:
return -1
print(maxTemp("new.csv"))
Explanation:
#section 1:
The function maxTemp is defined. We import pathlib in other to check if the file exists, if it does we carry on with opening the file and if it doesn't the program returns -1.
#section 2:
We start splitting the sub-lists from the second line i.e <em>next(f)</em>. For each line we take the second index element and convert it to an integer.
<em>res = [int(sub.split(',')[1]) for sub in f]
</em>
The maximum number is gotten by using the if statement to compare all elements in the list. The index of the maximum item in the list is collected.
the file is then closed.
#section 3 :
The file is re-opened and all the lines are striped and passed into a new list and the index recovered from section 2, is used to get the day with the highest temperature and the line is returned.
Answer:
Popular Electronics is the correct answer.
Explanation:
It is the first magazine that released in the year 1975, Jan. The following magazine is about the initial microcomputer kit which for the Mits Altair.
So, that's why the following answer is not false because it is the first magazine that released the article about the following microcomputer kit that is update on the cover of the magazine.
Answer:
formula bar shows the contents of the current cell and allows you to create and view the formulas
The pronoun is used in the second sentence as To link a subject with the word(s)that describes it.
<h3>What is a pronoun?</h3>
This is known to be a word or phrase that is said to be used to replace a noun or noun phrase.
Note that in the above sentence, the pronoun " their" is used to The pronoun is used in the second sentence as To link a subject with the word(s)that describes it as it tells more about service project.
Learn more about pronoun from
brainly.com/question/395844
#SPJ1