40 Important Questions of While loop in Python (Solved) Class 11

Share with others

While loop in Python
While loop in Python

Programs of while loop in Python

Q1. Write a program to print the following using while loop

a. First 10 Even numbers

b. First 10 Odd numbers

c. First 10 Natural numbers

d. First 10 Whole numbers

Programs of while loop in Python

Q2. Write a program to print first 10 integers and their squares using while loop.

1 1

2 4

3 9 and so on


Q3. Write for loop statement to print the following series:

10, 20, 30 … … 300

Q4. Write a while loop statement to print the following series

105, 98, 91 ………7.

Q5. Write a program to print first 10 natural number in reverse order using while loop.

Programs of while loop in Python

Q6. Write a program to print sum of first 10 Natural numbers.


Q7. Write a program to print sum of first 10 Even numbers.

Q8. Write a program to print table of a number entered from the user.

Q9. Write a program to print all even numbers that falls between two numbers (exclusive both numbers) entered from the user using while loop.

Programs of while loop in Python

Q10. Write a program to check whether a number is prime or not using while loop.

While loop in Python
While loop in Python

Q11. Write a program to find the sum of the digits of a number accepted from the user.

Q12. Write a program to find the product of the digits of a number accepted from the user.

Programs of while loop in Python

Q13. Write a program to reverse the number accepted from user using while loop.

Q14. Write a program to display the number names of the digits of a number entered by user, for example if the number is 231 then output should be Two Three One

Programs of while loop in Python

Q15. Write a program to print the Fibonacci series till n terms (Accept n from user) using while loop.

Q16. Write a program to print the factorial of a number accepted from user.

Programs of while loop in Python

Q17. Write a program to check whether a number is Armstrong or not. (Armstrong number is a number that is equal to the sum of cubes of its digits for example : 153 = 1^3 + 5^3 + 3^3.)

Q18. Write a program to add first n terms of the following series using a for loop:

1/1! + 1/2! + 1/3! + …….. + 1/n!

Programs of while loop in Python

Q19. Write a program to enter the numbers till the user wants and at the end it should display the sum of all the numbers entered.

Q20. Write a program to enter the numbers till the user enter ZERO and at the end it should display the count of positive and negative numbers entered.

While loop in Python
While loop in Python

Programs of while loop in Python

Q21. Write a program to find the HCF of two numbers entered from the user.

Q22. Write a program to convert Decimal to Binary.

Programs of while loop in Python

Q23. Write a program to convert Binary to Decimal.

Q24. Write a program to check whether a number is palindrome or not.

Programs of while loop in Python

Q25. Write a python program  to sum the sequence:
1 + 1/1! + 1/2! + 1/3! + …….. + 1/n!

Q26. Write a program to accept 10 numbers from the user and display it’s average

Programs of while loop in Python

Q27. Write a program to accept 10 numbers from the user and display the largest & smallest number number.

Q28. Write a program to display sum of odd numbers and even numbers separately that fall between two numbers accepted from the user.(including both numbers) using while loop.

Programs of while loop in Python

Q29. Write a program to display all the numbers which are divisible by 13 but not by 3 between 100 and 500.(exclusive both numbers)


Q30. Write a program to print the following series till n terms.

2 , 22 , 222 , 2222 _ _ _ _ _ n terms

While loop in Python
While loop in Python

Programs of while loop in Python

Q31. Write a program to print the following series till n terms.

1 4 9 16 25 _ _ _ _ _ n terms.

Q32. Write a program to find the sum of the following series(accept values of x and n from user)

1 + x/1! + x2/2! + ……….xn/n!

Q33. Write a program to find the sum of following series :

x + x2/2 + ……….xn/n

Programs of while loop in Python

Q34. Write a program to find the sum of following series

1 + 8 + 27 …………n terms

Q35. Write a program to find the sum of following series:

1 + 2 + 6 + 24 + 120 . . . . . n terms

Programs of while loop in Python

Q36. Write a program to find the sum of following series:

S = 1 + 4 – 9 + 16 – 25 + 36 – … … n terms

Programs of while loop in Python

Q37. Write a Program to print all the characters in the string ‘PYTHON’ using while loop.


Programs of while loop in Python

Q38. Write a program to print only odd numbers from the given list using while loop. L = [23, 45, 32, 25, 46, 33, 71, 90]

Programs of while loop in Python

Q39. Write a program to print all the factors of a number using for loop.

Programs of while loop in Python

Q40. Write a python program to get the following output

1—–49

2—–48

3—–47

. .

. .

. .

48—–2

49—–1

Programs of while loop in Python


Disclaimer : I tried to give you the correct Solution of “programs of while Loop in Python” , but if you feel that there is/are mistakes in the solution of “programs of while Loop in Python given above, you can directly contact me at csiplearninghub@gmail.com.


Programs of while loop in Python

Important Links

100 Practice Questions on Python Fundamentals

120+ MySQL Practice Questions

90+ Practice Questions on List

50+ Output based Practice Questions

100 Practice Questions on String

70 Practice Questions on Loops

120 Practice Questions of Computer Network in Python

70 Practice Questions on if-else

40 Practice Questions on Data Structure

Class 12 Computer Science Sample Paper 2020-2021.

Class 12 Computer Science Sample Paper Marking Scheme

Class 12 Computer Science Test Series


Share with others

11 thoughts on “40 Important Questions of While loop in Python (Solved) Class 11”

  1. Pingback: Amazing Site
  2. Correct Sol for Q9:

    num1 = int(input(“Enter first number: “))
    num2 = int(input(“Enter second number: “))
    if num1 < num2:
    while num1 < num2:
    if num1 % 2 == 0:
    print(num1, end=', ')
    num1 = num1 + 1
    else:
    while num2 < num1:
    if num2 % 2 == 0:
    print(num2, end=', ')
    num2 = num2 + 1

    Reply
  3. Q.13
    This website is given code you use the output print infinity time.

    a=int(input(“enter the numbers :”))
    b=0
    while(a>0):
    c=a%10
    e=b*10+c
    d=a//10
    print(e,d)
    break

    Reply

Leave a Reply

error: Content is protected !!