Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #1)
- n = int(input())
- m = int(input())
- a = []
- a.append(n)
- a.append(m)
- print(a,sum(a))
- #Ответ: [12,34] 46
- #2)
- x = input()
- x = x.split(' ')
- a = []
- for i in range(len(x)):
- a.append(x[i])
- print(a[0], a[-1])
- #Ответ: Программирование школы
- #3)
- s = ''
- x = input()
- x = x.split(' ')
- a = []
- for i in range(len(x)):
- a.append(x[i])
- if len(a[i]) > len(s):
- s = a[i]
- print(s)
- #Ответ: нетипичный
- #4)
- n = int(input())
- a = []
- for i in range(1,n + 1):
- if i % 3 == 0 or i % 5 == 0:
- a.append(i)
- print(sum(a))
- #Ответ: 234168
- #5)
- maxim = 0
- x = input()
- x = x.split(' ')
- a = []
- count = 0
- for i in range(len(x)):
- a.append(x[i])
- for x in a:
- if a.count(x) > maxim:
- maxim = a.count(x)
- print(x)
- #Ответ: cat
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement