Advertisement
webbersof

Untitled

Oct 27th, 2021
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.53 KB | None | 0 0
  1. starting_interval_first_number_from_number_one = int(input())
  2. starting_interval_second_number_from_number_one = int(input())
  3. starting_interval_first_number_from_number_two = int(input())
  4. starting_interval_second_number_from_number_two = int(input())
  5. number_of_changes = 0
  6. condition = False
  7.  
  8. #   Дефинираме си всички for проверки една под друга, без ифове, тъй като за да продължи нататък, трябва да е в зададените  #   граници. След това си извършваме вътре проверките.
  9.  
  10. for first in range(starting_interval_first_number_from_number_one, 8 + 1):
  11.     for second in range(9, starting_interval_second_number_from_number_one - 1, -1):
  12.         for third in range(starting_interval_first_number_from_number_two, 8 + 1):
  13.             for forth in range(9, starting_interval_second_number_from_number_two - 1, -1):
  14.  
  15.                 if first % 2 == 0 and second % 2 != 0 and third % 2 == 0 and forth % 2 != 0:
  16.                     if first == third and second == forth:
  17.                         print('Cannot change the same player.')
  18.                     else:
  19.                         print(f'{first}{second} - {third}{forth}')
  20.                         number_of_changes += 1
  21.  
  22.                     if number_of_changes == 6:
  23.                         condition = True
  24.                         break
  25.             if condition:
  26.                 break
  27.         if condition:
  28.             break
  29.     if condition:
  30.         break
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement