The following program demonstrates how to Create a Simple Addition Quiz in Python.
Basically, this program demonstrates the use of randint() function of the random object in python. This function generates a random number between two values given as its parameters.
# programmingempire.com
import random
number1 = random.randint(0,10)
number2 = random.randint(0,10)
answer =eval(input("What is" + str(number1)+ " + " +str(number2) + "?"))
print(number1,"+", number2,"=",answer, "is",number1+number2 ==answer)
Output

Further Reading
Examples of OpenCV Library in Python
A Brief Introduction of Pandas Library in Python
A Brief Tutorial on NumPy in Python
- Angular
- ASP.NET
- C
- C#
- C++
- CSS
- Dot Net Framework
- HTML
- IoT
- Java
- JavaScript
- Kotlin
- PHP
- Power Bi
- Python
- Scratch 3.0
- TypeScript
- VB.NET
