-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHW1_Python
48 lines (40 loc) · 942 Bytes
/
HW1_Python
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Task 1
def secondConversion(seconds):
days = seconds//86400
remainder1 = seconds%(86400) #dayseconds = 60*60*24
hours = remainder1//(3600)
remainder2 = remainder1%(3600)
minutes = remainder2//(60)
remainder3 = remainder2%(60)
print('There are',days, 'day(s)', hours, 'hour(s)', minutes, 'minute(s)', remainder3, 'second(s) in', seconds, 'seconds.')
q1 = 1000000
secondConversion(q1)
q2 = 4000
secondConversion(q2)
# 7,625,597,484,987 in class
q3 = 7625597484987
secondConversion(q3)
# Task 2
def gradeConversion():
score = int(input('Enter your grade: '))
if score >= 93:
print('A')
elif score >= 90:
print('A-')
elif score >= 87:
print('B+')
elif score >= 83:
print('B')
elif score >= 80:
print('B-')
elif score >= 77:
print('C+')
elif score >= 73:
print('C')
elif score >= 70:
print('C-')
elif score >= 65:
print('D')
else:
print('F')
gradeConversion()