-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTask0.py
32 lines (27 loc) · 963 Bytes
/
Task0.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""
Read file into texts and calls.
It's ok if you don't understand how to read files.
"""
import csv
# Read from excel file (texts.csv).
with open('texts.csv', 'r') as f:
reader = csv.reader(f)
texts = list(reader)
# Read from excel file (calls.csv).
with open('calls.csv', 'r') as f:
reader = csv.reader(f)
calls = list(reader)
"""
TASK 0:
What is the first record of texts and what is the last record of calls?
"""
print("First record of texts,", texts[0][0], "texts", texts[0][1], "at time", texts[0][2])
print("Last record of calls,", calls[-1][0], "calls", calls[-1][1], " at time", calls[-1][2], "lasting", calls[-1][3]
, "seconds")
"""
TASK 0:
What is the first record of texts and what is the last record of calls?
Print messages:
"First record of texts, <incoming number> texts <answering number> at time <time>"
"Last record of calls, <incoming number> calls <answering number>, at time <time>, lasting <during> seconds"
"""