_Suraj_

Maths_questions_using_Python

Oct 1st, 2023
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | Source Code | 0 0
  1.  
  2. # Let's check your Maths Knowledge
  3.  
  4. from random import randint
  5. correct =0
  6.  
  7. for _ in range(20):
  8.     a=randint(0,100)
  9.     b=randint(0,100)
  10.     rd= a+b
  11.     print(a,"+",b,"=")
  12.     r = int(input())
  13.    
  14.     if r==rd:
  15.         print('Right AnswerπŸ‘')
  16.     else:
  17.         print('Worng AnswerπŸ₯Ί')  
  18.         correct += 1
  19.        
  20. print("it's over, questions complete.πŸ…πŸ…πŸ…")
  21. print("Happy CodingπŸ˜…")
Tags: python
Advertisement
Add Comment
Please, Sign In to add comment