#1. Write a Python program to check whether a given number is Prime or not.
num = int(input(“enter a nummber”))
if num >1:
for i in range(2,num):
if num % i == 0:
print(“even number”)
break
else:
print(“prime number”)
else:
print(“number is not prime number”)
#2. Write a Program to accept a number and check whether it is a Perfect number or not.
import math
num= int(input(“enter a number”))
sum = 0
for i in range(1,num):
if num % i == 0:
sum = sum+i
if sum == num:
print(“number is perfect”)
else:
print(“number is not perrfect”)
#3. Write a Program to accept a number and check whether it is a Strong number or not.
import math
num = int(input(“enter a number”))
sum = 0
original = num
while num !=0:
rem = num %10
sum = sum +(math.factorial(rem))
num = num // 10
if sum == original:
print(“number is a strong”)
else:
print(“number is not strong”)
#5. Write a Program to accept a number and check whether it is a Armstrong number or not.
num = int(input(“enter a number”))
count = len(str(num))
sum = 0
original= num
while num!=0:
rem = num %10
sum = sum +(rem**count)
num = num//10
if sum == original:
print(“number is armstrong”)
else:
print(“number is not armstrong”)
#6. Write a Program to display product of the digits of a number accepted from the user.
num = int(input(“enter a numbr”))
product = 1
while num!=0:
rem = num%10
product = rem*product
num = num//10
print(“product if digits of given number is:”,product)
#7. Write a Program to find the sum of the digits of a number accepted from user
num = int(input(“enter a number”))
sum = 0
while num!=0:
rem = num%10
sum+=rem
num=num//10
print(“sum of digits of given number is”,sum)