Python Practice Questions
Read the question
Perfect number
Read a positive integer and print whether it is a perfect number: equal to the sum of its divisors other than itself (6 = 1 + 2 + 3).
Sample input
8128
Sample output
8128 is a perfect number
Solve a Python programming question, press Check, and your program is run against hidden test cases in real Python. Then take the next one — the numbers change every time, so it never repeats.
How This Practice Works
- Read the question. Choose Easy, Medium or Hard if you want a particular level.
- Write your answer in the editor and press Run to try it — type the input in the Output box when your program asks.
- Press Check answer. Every requirement is tested and you see exactly which ones passed.
- Press Next question for a new one. Each question is generated with new values, so you do not get the same one twice.
- Your score and streak are kept on this device. A question counts as solved only if you solve it before opening the solution.
Frequently Asked Questions
How are the Python questions checked?
Your program is run in real Python inside your browser with the sample input and with a hidden test input. The values your program prints are compared with the right answer. Prompts such as "Enter a number:" and extra words are ignored — the numbers and results must be right.
Will I get the same question again?
Rarely. Every question is generated with new numbers and words, and this device remembers what you have already seen, so you keep getting fresh questions.
Which topics are covered?
Input and operators, if/else, for and while loops, strings, lists, dictionaries, functions, nested loops and patterns — the topics of NIELIT O Level M3-R5.1 and the PR-3 practical.
What if I cannot solve a question?
Open the hint first. If you are still stuck, Show solution displays a model answer. Type it yourself instead of copying — that is how it stays in memory.
Is it free?
Yes, free and without login. Your score and streak are saved on this device.
