Advertisement
nq1s788

Untitled

Sep 1st, 2023
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. from random import randint
  2.  
  3.  
  4. def initialize():
  5.     global x, y, z, answer
  6.     x = randint(1, 100)
  7.     y = randint(1, 100)
  8.     z = randint(1, 100)
  9.     answer = x + y - z
  10.  
  11.  
  12. initialize()
  13. print('Решите пример: ', x, '+', y, '-', z, sep='')
  14. suggest = int(input())
  15. if suggest == answer:
  16.     print('Верно!')
  17. else:
  18.     print('Неверно!')
  19. print('Вы ввели:', suggest)
  20. print('Ответ был:', answer)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement