-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path딕셔너리삽입.py
51 lines (37 loc) · 997 Bytes
/
딕셔너리삽입.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
N=int(input())
city={}
cnt = 0
while cnt<N:
name=input()
pop=int(input())
side=int(input())
city[name]=pop/side
cnt+=1
for key,value in city.items():
if value==max(city.values()):
max_key=key
print("Highest Population Density = %s, %.2f"%(max_key,max(city.values())))
n=int(input())
s_s=[]
s_avg=[]
for i in range(n):
for j in range(3):
score=int(input())
s_s.append(score)
s_avg.append(sum(s_s)/3)
print("Student%d point = %d"%(i+1,s_avg[i]))
s_s=[0]*3
for i in range(n):
if s_avg[i]==max(s_avg):
highest_stu=i+1
print("Highest Score Student =",highest_stu)
N=input()
x=list(N) #(ABC받고 A,B,C) +int형은 이터러블하지 못해서 리스트화 안댐
cntup=cntdw=0
for i in range(len(x)):
if 'A'<=x[i] and x[i]<='Z':
cntup+=1
elif 'a'<=x[i] and x[i]<='z':
cntdw+=1
print("UPPER :",cntup)
print("LOWER :",cntdw)