'Answer1 :
dim numpy as np
a = np.array([75,80,65])
print(np.sum(a))
print(np.mean(a))
'Answer2:
a = 75
b = 80
c = 65
scores = a + b + c
ms = scores/3
print(scores)
print(ms)
Coding
scord = []
first_scord = int(input("1st 期中考: "))
scord.append(first_scord)
second_scord = int(input("2nd 期中考: "))
scord.append(second_scord)
final_socrd = int(input("期末考: "))
scord.append(final_socrd)
total = sum(scord)
avg = round(total/len(scord), 2)
print("1st 期中考:{}\n2nd 期中考:{}\n期末考:{}\n總分:{}, 平均:{}".format(first_scord, second_scord, final_socrd, total, avg))
Result
1st 期中考:75
2nd 期中考:80
期末考:65
總分:220, 平均:73.33