Advertisement
sigmachto

Untitled

Jul 2nd, 2023
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.83 KB | None | 0 0
  1.  
  2. #1)
  3. n = int(input())
  4. m = int(input())
  5. a = []
  6. a.append(n)
  7. a.append(m)
  8. print(a,sum(a))
  9. #Ответ: [12,34] 46
  10.  
  11.  
  12. #2)
  13. x = input()
  14. x = x.split(' ')
  15. a = []
  16. for i in range(len(x)):
  17.     a.append(x[i])
  18. print(a[0], a[-1])
  19. #Ответ: Программирование школы
  20.  
  21. #3)
  22. s = ''
  23. x = input()
  24. x = x.split(' ')
  25. a = []
  26. for i in range(len(x)):
  27.     a.append(x[i])
  28.     if len(a[i]) > len(s):
  29.         s = a[i]
  30. print(s)
  31. #Ответ: нетипичный
  32.  
  33. #4)
  34. n = int(input())
  35. a = []
  36. for i in range(1,n + 1):
  37.     if i % 3 == 0 or i % 5 == 0:
  38.         a.append(i)
  39. print(sum(a))
  40. #Ответ: 234168
  41.  
  42. #5)
  43. maxim = 0
  44. x = input()
  45. x = x.split(' ')
  46. a = []
  47. count = 0
  48. for i in range(len(x)):
  49.     a.append(x[i])
  50. for x in a:
  51.     if a.count(x) > maxim:
  52.         maxim = a.count(x)
  53.         print(x)
  54. #Ответ: cat
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement