subject

1 #write a function called "reader" that reads in a " . cs1301" 2 #file described in the previous problem. The function should
3 #return a list of tuples representing the lines in the file like so:
4 #
5 #[(line-1-number, line-1-assignment-name, line-1-grade, line-2-grade, line-1-total , line-2-total , line-1-weight), line-2-weight)]
6 #(line-2-number, line-2-assignment-name,
7 #
8 #All items should be of type int except for the name (string)
9 #and the weight (float). You can assume the file will be in the
10 #proper format -- in a real program, you would use your code
11 #from the previous problem to check for formatting before
12 #trying to call the function below.
13 #
14 #Hint: Although you could use readlines() to read in all
15 #the lines at once, they would all be strings, not a list.
16 #You still need to go line-by-line and convert each string
17 #to a list.
18 #
19 #
20 #write your function here!
21 #
23 #
24 #Below are some lines of code that will test your function.
25 #You can change the value of the variable (s) to test your 2
6 #function with different inputs.
27 #
28 #If your function works correctly, this will originally
29 #print:
30 #1(1, 'assignment-1 ', 85, 100, 0.25), (2, 'test-1', 90, 100, 0.25), (3, 'exam-1 ', 95, 100, 0.5)]
31 print (reader( "sample. cs1301"))

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 04:30
Kyle, a receptionist for a building supply company, recently won an award for saving his company money on their phone system. after being presented with kyle's research, the company changed the way in which it made long-distance phone calls and cut their expenses in this area by 75 percent. the new system the kyle's company most likely adopted was wired communications switching stations voip hdtv
Answers: 3
question
Computers and Technology, 22.06.2019 19:10
10. when you create a pivottable, you need to specify where to find the data for the pivottable. is it true
Answers: 2
question
Computers and Technology, 23.06.2019 15:00
To check whether your writing is clear , you can
Answers: 2
question
Computers and Technology, 24.06.2019 16:30
You may see the term faq on websites which stands for frequently asked questions this is an example of which type of mnemonic? a) poem b) acronym c) acrostic d) abbreviation ken has dipped many dark chocolate marshmallows (which you remember the metric system distance units in decreasing order: kilometers, hectometer, decameter, centimeter, millimeter) is an example of which type of mnemonic? a) poem b) acronym c) acrostic d) abbreviation !
Answers: 1
You know the right answer?
1 #write a function called "reader" that reads in a " . cs1301" 2 #file described in the previous p...
Questions
question
Social Studies, 14.09.2020 19:01
question
Mathematics, 14.09.2020 19:01
question
Arts, 14.09.2020 19:01
question
Mathematics, 14.09.2020 19:01
question
Mathematics, 14.09.2020 19:01
question
Mathematics, 14.09.2020 19:01
question
Mathematics, 14.09.2020 19:01
question
Mathematics, 14.09.2020 19:01
question
Chemistry, 14.09.2020 19:01
question
Mathematics, 14.09.2020 19:01
question
Biology, 14.09.2020 19:01
question
Mathematics, 14.09.2020 19:01
question
English, 14.09.2020 19:01
question
Mathematics, 14.09.2020 19:01
question
Mathematics, 14.09.2020 19:01
question
Mathematics, 14.09.2020 19:01
question
Social Studies, 14.09.2020 19:01
question
Mathematics, 14.09.2020 19:01
question
English, 14.09.2020 19:01
question
Mathematics, 14.09.2020 19:01
Questions on the website: 13722363