0% found this document useful (0 votes)
45 views2 pages

Python Loops and Conditions: 60 Questions

The document contains a list of 60 programming questions categorized into three levels: Beginner, Intermediate, and Advanced. Each category includes 20 questions focused on Python loops, conditions, input, and print statements, covering various programming concepts and problem-solving techniques. The questions range from simple tasks like printing numbers to more complex problems like finding prime numbers and calculating averages.

Uploaded by

utkarshhzp0105
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views2 pages

Python Loops and Conditions: 60 Questions

The document contains a list of 60 programming questions categorized into three levels: Beginner, Intermediate, and Advanced. Each category includes 20 questions focused on Python loops, conditions, input, and print statements, covering various programming concepts and problem-solving techniques. The questions range from simple tasks like printing numbers to more complex problems like finding prime numbers and calculating averages.

Uploaded by

utkarshhzp0105
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Python Loops, Conditions, Input & Print - 60

Questions

■ Beginner (Low Level – 20 Questions)

1. Write a program to take your name as input and print it.


2. Take two numbers as input and print their sum.
3. Take two numbers and print which one is greater.
4. Check if a number is even or odd.
5. Take a number and check if it is positive, negative, or zero.
6. Take age as input and check if the person is eligible to vote (18+).
7. Take marks as input and print “Pass” if marks ≥ 40 else “Fail”.
8. Print numbers from 1 to 10 using a for loop.
9. Print numbers from 10 to 1 using a while loop.
10. Print all even numbers from 1 to 20.
11. Print all odd numbers from 1 to 20.
12. Print the multiplication table of any number entered by the user.
13. Find the sum of first 10 natural numbers.
14. Find the sum of all even numbers between 1 and 100.
15. Print each character of your name using a for loop.
16. Check if a given number is divisible by 5 and 11.
17. Take 3 numbers and find the largest one.
18. Print “Hello” 5 times using a loop.
19. Print the square of numbers from 1 to 10.
20. Print the cube of numbers from 1 to 5.

■ Intermediate (Mid Level – 20 Questions)

21. Check whether a number is a prime number.


22. Print the factorial of a number.
23. Print the Fibonacci series up to n terms.
24. Count how many digits are in a number.
25. Find the sum of digits of a number.
26. Reverse a given number.
27. Check whether a number is a palindrome.
28. Check whether a number is an Armstrong number.
29. Find the largest and smallest numbers from 3 inputs using nested if.
30. Print the multiplication tables from 1 to 5 using nested loops.
31. Print a pattern: *, **, ***, ****, *****
32. Print a reverse pattern: *****, ****, ***, **, *
33. Print pattern of numbers: 1, 12, 123, 1234
34. Print the sum of all numbers between two input numbers.
35. Count how many even and odd numbers are between 1 and n.
36. Take 10 inputs from the user and count how many are positive or negative.
37. Find the greatest common divisor (GCD) of two numbers.
38. Find the least common multiple (LCM) of two numbers.
39. Check if a year is a leap year.
40. Print all numbers divisible by both 3 and 5 between 1 and 100.

■ Advanced (High Level – 20 Questions)

41. Print all prime numbers between 1 and 100.


42. Find all Armstrong numbers between 1 and 1000.
43. Find the factorial of each number from 1 to 10.
44. Take a string input and count vowels and consonants.
45. Check if a string is a palindrome.
46. Take n numbers as input and print their average.
47. Find the largest number in a list (using loop only).
48. Find the second largest number in a list.
49. Count how many times a number appears in a list.
50. Print all even numbers from a list.
51. Print the sum of all odd numbers from a list.
52. Print this pattern: 1, 22, 333, 4444, 55555
53. Print a pyramid pattern of stars.
54. Print a pattern of alphabets: A, AB, ABC, ABCD.
55. Check whether a number is perfect (sum of divisors = number).
56. Find all perfect numbers between 1 and 1000.
57. Print the sum of prime numbers between 1 and 50.
58. Print all palindrome numbers between 1 and 500.
59. Print the sum of digits for all numbers between 1 and n.
60. Take an integer and print its binary representation using loops.

You might also like