ppppp

ppppp

ppppp

 

import random
list1 = [‘+’, ‘-‘, ‘/’, ‘*’, ‘**’, ‘//’]
n=3
while n!=0 :
op = random.choice(list1)
a = int(random.random()*100)
b = int(random.random()*100)
print(a,op,b)
res=int(input())
exp=str(a)+op+str(b)
ans=eval(exp)
if ans==res:
print(“Correct”)
else:
print(“Incorrect”)
n=n-1

 

Scroll to Top