Computer Project by Rohit
Computer Project by Rohit
Public School
Bistupur, Jsr
OPERATION
ON NUMBERS
Name: Rohit Kundu
Roll No: 46
Class: XI ‘A3’
(Along With):
Anuj Kumar Ranjan (10)
Certificate Of Completion
• Overview Of Python
• Need for the Project
• Requirements
• Object Description
• Flow chart
• Source Code
• Output
• Shortcomings
• Bibliography
Overview Of Python
# Armstrong Number.
elif choice==3:
s=0
t=n
while t>0:
d = t % 10 # Separating digits of the number.
s += d ** 3 # Adding the cube of the digits.
t //= 10
if n == s:
print(n,"is an Armstrong number.")
else:
print(n,"is not an Armstrong number.")
# Perfect Number.
elif choice == 4:
s1=0
for i in range(1,n):
if n%i==0:
s1=s1+i
if s1==n:
print(n,"is a Perfect number.")
else:
print(n,"is not a Perfect number.")
# Happy Number
elif choice == 5:
s=0
while n>9:
while n>0:
k=n%10 # Separating digits
s=s+k*k
n=n//10
n=s
s=0
if n==1:
print("Happy Number.")
else:
print("Not a Happy Number.")
# Automorphic Number
elif choice==6:
temp=n
sq=temp**2 #Squaring the number.
if n%10==sq%10:
print(n,"is an Automorphic number.")
else:
print(n,"is not an Automorphic number.")
# Special Number.
elif choice==7:
temp=n
s=0
while(n>0):
r=n%10
f=1
for i in range(1,r+1):
f=f*i
s=s+f
n=n//10
if s==temp:
print(temp,"is a Special number.")
else:
print(temp,"is not a Special number.")
# Binary Equivalent
if choice==8:
lst=[]
k=n
while k>0:
d=k%2
lst.append(d)
k=k//2
lst.reverse()
print("Binary Equivalent of",n,"is : ",end="")
for i in lst:
print(i,end="")
# Magic number
elif choice == 9:
k=n
sum=0
while (k > 0 or sum > 9):
if (k == 0):
k = sum
sum = 0
sum = sum + k % 10
k = k//10
if sum==1:
print(n,"is a Magic number")
else:
print(n,"is not a Magic Number")
OUTPUTS
SHORTCOMINGS