Python Practice Questions

These questions are curated with the help of your favorite teachers to help you learn and grow!

S.NoQuestionPracticeFavourite
1Print 'Hello World' (Explained by teacher)Practice
1.1Print 'Hello World' (Try it on Hackerrank)Practice
2Print 'Code now, nap later!'Practice
3Print the number 2 (it should be an int)Practice
4Add 2 to 2 and print the result (explained by teacher)Practice
5Subtract 2 from 2 and print the resultPractice
6Multiply 2 by 2 and print the resultPractice
7Divide 2 by 2 and print the resultPractice
8Print 2 raised to the power of 3Practice
9Print the remainder when 7 is divided by 3 using the modulus operatorPractice
10Concatenate 'NIE' and 'Ved' using the plus operator and print the resultPractice
11Print 'one piece is real' 5 times using the '*' operatorPractice
12Print the result of 10 > 5 (use the comparison operator)Practice
13Check if 'apple' is equal to 'banana' using the equality operatorPractice
14Print 5 and 0 using the 'and' operatorPractice
15Print 5 or 0 using the 'or' operatorPractice
16Assign 10 to x and print itPractice
17Assign 10 to a valid variable and print itPractice
18Ask the user for an integer input, assign it to a variable, and print itPractice
19Ask the user for an integer input, assign it to a variable, add 10 to it, and print the resultPractice
20Ask the user for an integer input, assign it to a variable, check if it is 10, and print 'YES' if it is or 'NO' if it is notPractice
21Ask the user for an integer input, assign it to a variable, check if it is even or odd, and print 'Even' or 'Odd' accordingly.Practice
22Ask the user for an integer input, assign it to a variable, check if it is positive, negative, or zero, and print the corresponding result.Practice
23Ask the user for two integer inputs, assign them to variables, and print the greater number. If both are equal, print 'Equal'.Practice
24Ask the user for an integer input, assign it to a variable, check if it is divisible by 5, and print 'Divisible by 5' or 'Not Divisible by 5'.Practice
25Ask the user for their age, assign it to a variable, and check if they are eligible to vote (18 or above). Print 'Eligible to vote' or 'Not eligible to vote'.Practice
26Ask the user for a year input, assign it to a variable, check if it is a leap year or not, and print 'Leap Year' or 'Not a Leap Year'.Practice
27Ask the user for their marks (out of 100), assign it to a variable, and print 'Pass' if marks are 40 or more, otherwise print 'Fail'.Practice
28Ask the user for a single character input, assign it to a variable, and check if it is a vowel (a, e, i, o, u). Print 'Vowel' or 'Consonant'.Practice
29Ask the user for three integer inputs, assign them to variables, and print the largest number.Practice
30Ask the user for a username input, assign it to a variable, and check if it matches a predefined username. Print 'Access Granted' if it matches, otherwise print 'Access Denied'.Practice

Meet Minitheo :- The Lightweight AI Coder!

Generate websites effortlessly with `Minitheo`. Just describe your idea, and let AI do the rest!

Transform your ideas into reality. Try `Minitheo` today!

Try Minitheo

Tag us:
x.com/quadropic |linkedin.com/company/quadropic