UNIT-2
1. Python Program to take three numbers from the user and print the
greatest number.
2. Write a program to print whether given number is even or odd.
3. Write a program to print any person is eligible for vote or not (age
should not less then 18 for voting).
4. Write a Program to check Armstrong Number.
A positive integer of n digits is called an Armstrong number
of order n (order is number of digits) if.
abcd... = pow(a,n) + pow(b,n) + pow(c,n) + pow(d,n) + ....
\ Input: 153
Output: Yes
153 is an Armstrong number.
1*1*1 + 5*5*5 + 3*3*3 = 153
5. Write a program to check whether a number entered by user is Prime
or not.
6. Write a program to calculate factorial of a number entered by user.
7. Python Program to check whether a given number is a palindrome.
8. Write a program to print all Prime numbers between given range.
9. Write a program to print n-th Fibonacci number.
10. Write a program to check if a given number is Fibonacci number?
11. Write a program for Sum of squares of first n natural numbers.
Ex: if Input: N = 4
Then Output: 30
12 + 22 + 32 + 42 = 1 + 4 + 9 + 16 = 30
12. Write a program for cube sum of first n natural numbers.
13. WAP to print given pattern
14. WAP to print given pattern
15. Write a program to take an integer N as an input and display the
pattern.
Input
5
Output
*
**
***
****
*****
****
***
**
*