0% found this document useful (0 votes)
39 views

Loops - Programs For Practice - Python

The document outlines 18 programming problems including printing odd/even numbers, Armstrong and Nelson numbers, factorials, checking for primes, Fibonacci sequences, converting between decimal and binary, finding primes between 1-100, calculating series sums, looping to print "QUARANTINE", "VACCINE", and "CORONA" based on divisibility, calculating sums and averages of natural and input numbers, summing and reversing digits of numbers, calculating square roots, finding Pythagorean triplets, and printing multiplication tables from 1 to 10.

Uploaded by

Tarun Mishra
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

Loops - Programs For Practice - Python

The document outlines 18 programming problems including printing odd/even numbers, Armstrong and Nelson numbers, factorials, checking for primes, Fibonacci sequences, converting between decimal and binary, finding primes between 1-100, calculating series sums, looping to print "QUARANTINE", "VACCINE", and "CORONA" based on divisibility, calculating sums and averages of natural and input numbers, summing and reversing digits of numbers, calculating square roots, finding Pythagorean triplets, and printing multiplication tables from 1 to 10.

Uploaded by

Tarun Mishra
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Write a program to:

st st
1. Print 1 50 ODD numbers. ( 1 50 EVEN numbers)
2. Print all Nelson numbers.
3. Print all Armstrong numbers.
4. Print factorial of a number.
5. Check a number is a Prime number or not.
6. To print Fibonacci sequence of ‘n’ terms.(0,1,1,2,3,5,8,13,…)
7. To convert a decimal number to binary number.
8. To convert a binary number to decimal number.
9. To print all Prime numbers between 1 to 100.
10. To print Sum of series…
a. 1/1 + 1/2 + 1/3 +……+ 1/n
b. 1/1! + 1/2! + 1/3! +….+1/n!
c. 1/1! + 2/2! + 3/3! +….+n/n!
n
d. 1/1! + 4/2! + 27/3! +….+n /n!

11. Execute a loop from 1 to 100.


If the value of ‘i’ is divisible by 3, print, “QUARANTINE”.
If the value of ‘i’ is divisible by 5, print, “VACCINE”.
If the value of ‘i’ is divisible by both 3 & 5, print “CORONA”.
st
12. Write a program to print sum and average of 1 ‘n’ Natural numbers.
13. Write a program to print sum and average of ‘n’ numbers.
14. Write a program to print sum of individual digits of a ‘n’ digit number.
15. Write a program to print reverse of a ‘n’ digit number.
y -y
16. Write a program to print x or x .
2 2 2
17. Write a program to print Pythagorean triplet. ( z = x + y ).
18. Write a program to print multiplication table from 1 X 1 to 10 X 10.

You might also like