A simple command-line quiz/exam simulator written in Python that runs an online examination, marks answers automatically, and shows the final result with a grade and percentage.
- 10 MCQs on Python basics (collections, operators, strings, loops)
- Automatic scoring and percentage calculation
- Grade based on percentage (A+ to F)
- Performance message based on score
- Input validation — accepts only
A,B,CorD - Shows list of topics covered in the exam
- Python 3.6 or later
No third-party libraries are needed.
python quiz.py- Run the program.
- Enter your name when prompted.
- Answer each of the 10 questions by typing
A,B,CorD. - After the last question, the exam result (score, percentage, grade and performance) is shown.
==============================================
EXAM RESULT
==============================================
Student Name : Imtty
Total Questions : 10
Questions Attempted: 10
Correct Answers : 7
Wrong Answers : 3
Percentage : 70.0 %
Grade : B
==============================================
Performance : Good!
Topics Covered in Exam:
{'Loops', 'Tuples', 'Dictionary', 'Input and Print', 'Strings', 'Operators', 'Lists', 'Sets'}
The project demonstrates the use of:
- Dictionary — stores the questions and their answer keys
- Tuple — holds each question's options and correct answer
- List — stores the student's answers
- Set — tracks attempted questions and unique topics
- Loops — runs through all questions and validates input
- Operators — arithmetic, comparison and membership operators
- Strings & Input —
input(),.upper(),print()
simple-online-quiz-using-python/
└── quiz.py # main program
This project is for educational purposes.