forked from fenyx-it-academy/Class5-Python-Module-Week1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhackerrank.py
More file actions
31 lines (28 loc) · 761 Bytes
/
hackerrank.py
File metadata and controls
31 lines (28 loc) · 761 Bytes
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
#Arithmetic operators
if __name__ == '__main__':
a = int(input())
b = int(input())
print(a+b)
print(a-b)
print(a*b)
#find the runner up score
if __name__ == '__main__':
n = int(input())
arr = map(int, input().split())
print(sorted(list(set(arr)))[-2])
#print function
if __name__ == '__main__':
n = int(input())
for i in range(1, n+1):
print(i, end="")
#find the percentage
if __name__ == '__main__':
n = int(input())
student_marks = {}
for _ in range(n):
name, *line = input().split()
scores = list(map(float, line))
student_marks[name] = scores
query_name = input()
marks = student_marks[query_name]
print(format(sum(marks)/3, '.2f'))