dic1 ={"1":"Mon","2":"Tue","3":"Wed","4":"Thu","5":"Fri","6":"Sat","7":"Sun"}
n =input()print(dic1.get(n))
Chapter 5-2 showing FIG dictionary (20 minutes)
n =int(input())
dic ={}
count =0
summ =0for i inrange(n):
dic1 =eval(input())for j in dic1:
count +=len(dic1[j])
dic.update(dic1)for i in dic:for j in dic[i]:
summ += dic[i][j]print("{:} {:} {:}".format(n,count,summ))
Chapter 5-3 four arithmetic operations (to achieve a dictionary) (30 minutes)
a =float(input())
b =input()
c =float(input())
dic ={"+":"a+c","-":"a-c","*":"a*c","/":"a/c"}try:print("{:.2f}".format(eval(dic[b])))except ZeroDivisionError:print("divided by zero")
list1 =input().split(',')
res=""
dic ={}for i inrange(1,11):
dic[str(i)]=0for i in list1:
dic[i]+=1for i in dic:if dic[i]==0and i in['6','7','8','9','10']:
res += i +" "print(res[:len(res)-1])
Chapter 5-5 count the number of occurrences of characters (20 points)
res =input()
cha =input()
count =0for i in res:if i == cha:
count +=1print(count)
Chapter 5-6 seniority statistics (20 points)
dic ={}
n =int(input())
list1 =input().split()for i in list1:
dic[i]=0for i in list1:
dic[i]+=1for i inrange(0,51):ifstr(i)in dic:print("{0:}:{1:}".format(i,dic[str(i)]))
Chapter 5-7 list to weight (40 minutes)
list1 =eval(input())
list2 =[]
res =""for i in list1:if i notin list2:
list2.append(i)for i in list2:
res +=" "+str(i)print(res[1:])
Chapter 5 -8 and 3,5 number can be divisible by the number 7 (implemented collection) (30)
list1 =input().split()
start =int(list1[0])
end =int(list1[1])
count =0for i inrange(start, end+1):if i %3==0and i %7==0and i %5==0:
count +=1print(count)
Chapter 5-9 of Matrix number of saddle points (30 points)
n =int(input())
list1 =[]
count =0for i inrange(n):
tmp =input()
list1.append([int(n)for n in tmp.split()])for i inrange(n):
maxx =max(list1[i])for j inrange(n):if list1[i][j]== maxx:
list3 =[maxx]for q inrange(n):for w inrange(n):if q!=i and w == j:
list3.append(list1[q][w])ifmin(list3)== maxx:
count +=1print(count)
Chapter 5 -10 and two numbers (30 points)
list1 =input().split(",")
list2 =[]
flag =0for i in list1:
list2.append(int(i))
number =int(input())
length =len(list2)for i inrange(length):if flag ==1:breakfor j inrange(length):if i != j and list2[i]+ list2[j]== number:print(i,j)
flag =1if flag ==0:print("no answer")
Chapter 5-11 dictionaries merger (40 points)
dic1 =eval(input())
dic2 =eval(input())for i in dic2:if i notin dic1:
dic1[i]= dic2[i]else:
dic1[i]= dic1[i]+ dic2[i]
ans =dict(sorted(dic1.items(),key=lambda x:x[0]iftype(x[0])==intelseord(x[0])))print("{",end ="")
str1 =""for i in ans:iftype(i)==int:
str1 +=","+str(i)+":"+str(ans[i])else:
str1 +=","+"\""+str(i)+"\""+":"+str(ans[i])print(str1[1:],end ="")print("}")