AlexG2230954

ДЗ. Задание 2

May 21st, 2022 (edited)
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. n = int(input()) # кол-во загаданных чисел
  2. numbers = set(range(1, n + 1))
  3. beatris_turn = input()
  4.  
  5. while beatris_turn != "HELP":
  6.     named_numbers = set(map(int, beatris_turn.split()))
  7.     answer = input()
  8.  
  9.     if answer == "YES":
  10.         numbers.intersection_update(named_numbers)
  11.  
  12.     if answer == "NO":
  13.         numbers.difference_update(named_numbers)
  14.  
  15.     beatris_turn = input()
  16.  
  17. print(*sorted(numbers))
Add Comment
Please, Sign In to add comment