Computer Science, asked by shilpahoney17, 3 months ago

program to display two random number that are to be addedsuch as 247+129,the program should allow the student to enter the answer .if the answer is correct a message of congratulations should be displayed if the answee is incorrect a message showing the correct answer should be displayed in python.
i need a program and output

Answers

Answered by kabisimadgp
1

Answer:

We wish you a marry Christmas and a happy new year

Answered by udayagrawal49
1

Answer: The required python program is :-

import random

i1 = random.randnt(0,999)

i2 = random.randnt(0,999)

i3 = i1+i2

i = int(input(str(i1)+" + "+str(i2)+" = "))

if i==i3 :

   print("Congratulations!")

else :

   print("Correct answer is "+str(i3))

Sample output : (Here, 874 and 5 are inputs)

316 + 558 = 874

Congratulations!

316 + 558 = 5

Correct answer is 874

(In 3rd and 4th line from starting, it shoud be rand-int where "-" should not come. Brainly doesn't allow me to write the exact word.)

Please mark it as Brainliest.

Similar questions