Advertisement
JmihPodvalbniy

Untitled

Apr 24th, 2024
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.65 KB | Software | 0 0
  1. 1)--------
  2. #num_list = [1, 2, 3, 1, 2]
  3. #
  4. # set_num_list = set(num_list)
  5. #
  6. # print(len(set_num_list))
  7. 2)--------
  8. #list_1 = {1, 3, 2}
  9. # list_2 = {4, 3, 2}
  10. #
  11. # print(len(list_1 & list_2))
  12. 3)--------
  13. # list_1 = {1, 3, 2}
  14. # list_2 = {4, 3, 2}
  15. #
  16. # print(list(list_1 & list_2))
  17. 4)--------
  18. list_1 = [1, 2, 3, 2, 3, 4]
  19. # set_list = set()
  20. #
  21. # for char in list_1:
  22. #     if char in set_list:
  23. #         print("Yes")
  24. #     else:
  25. #         print("No")
  26. #         set_list.add(char)
  27. 5)--------
  28. print("Введите N и M")
  29. # N, M = map(int, input().split())
  30. #
  31. # colors_Anya = set()
  32. # colors_Borya = set()
  33. #
  34. # for i in range(N):
  35. #     color = int(input("Введите цвет Ани"))
  36. #     colors_Anya.add(color)
  37. #
  38. # for i in range(M):
  39. #     color = int(input("Введите цвет Бори"))
  40. #     colors_Borya.add(color)
  41. #
  42. # common_colors = colors_Anya & colors_Borya
  43. # only_colors_Anya = colors_Anya = common_colors
  44. # only_colors_Borya = colors_Borya = common_colors
  45. #
  46. # print(len(common_colors))
  47. # print(*sorted(common_colors))
  48. # print(len(only_colors_Anya))
  49. # print(*sorted(only_colors_Anya))
  50. # print(len(only_colors_Borya))
  51. # print(*sorted(only_colors_Borya))
  52. 6)--------
  53. #num_list = int(input("Напишите число строк: "))
  54. #
  55. # unique_words = set()
  56. #
  57. # for i in range(num_list):
  58. #     list_1 = input("Напишите строку(и): ").split()
  59. #     unique_words.update(list_1)
  60. #
  61. # print(len(unique_words))
  62. 7)--------
  63. #n = int(input("Август загадал натуральное число: "))
  64. # possible_numbers = set(range(1, n+1))
  65. #
  66. # while True:
  67. #     question = input('Введите вопрос: ')
  68. #     if question == "Help":
  69. #         break
  70. #     else:
  71. #         numbers = set(map(int, question.split()))
  72. #         answer = input("Напишите ответ(Yes, No): ")
  73. #         if answer == "Yes":
  74. #             possible_numbers &= numbers
  75. #         else:
  76. #             possible_numbers -= numbers
  77. #             print("No")
  78. #
  79. # print(*possible_numbers)
  80. 8)--------
  81. #n = int(input('Август загадал натуральное число: '))
  82. # s = set(range(1, n + 1))
  83. # answer = []
  84. #
  85. # while True:
  86. #     request = input('Введите вопрос: ')
  87. #
  88. #     if request == 'Help':
  89. #         break
  90. #
  91. #     request = set([int(i) for i in request.split()])
  92. #
  93. #     if len(request) > len(s) / 2:
  94. #         s &= request
  95. #         answer.append('Yes')
  96. #     else:
  97. #         s -= request
  98. #         answer.append('No')
  99. #
  100. # for i in answer:
  101. #     print(i)
  102. #
  103. # print('Август задумал числа: ', *sorted(list(s)))
  104. 9)--------
  105.  
  106. 10)-------
  107.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement