0% found this document useful (0 votes)
37 views23 pages

Computer Project by Rohit

Rohit Kundu and Anuj Kumar Ranjan of class 11 A3 completed a project on operations with numbers in Python under the supervision of their teacher, Mrs. Jaya Chakraborty. The project allows a user to enter a number and perform calculations to determine if it is prime, factorial, Armstrong, perfect, happy, automorphic, special, or binary. It also checks if the number is magic. The project includes source code, outputs, and acknowledges help from teachers. It notes potential shortcomings like speed and logical errors.

Uploaded by

Rohit Kundu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views23 pages

Computer Project by Rohit

Rohit Kundu and Anuj Kumar Ranjan of class 11 A3 completed a project on operations with numbers in Python under the supervision of their teacher, Mrs. Jaya Chakraborty. The project allows a user to enter a number and perform calculations to determine if it is prime, factorial, Armstrong, perfect, happy, automorphic, special, or binary. It also checks if the number is magic. The project includes source code, outputs, and acknowledges help from teachers. It notes potential shortcomings like speed and logical errors.

Uploaded by

Rohit Kundu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

D.A.V.

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

This is to certify that Rohit Kundu


having Roll no: 46, along with Anuj
Kumar Ranjan (Roll No: 10), of Std.
XI A3 has successfully completed the
project “Operation On Numbers” in
Computer Science in the session
2022-23 as ascribed by AISSCE
under the supervision of Mrs. Jaya
Chakraborty ma’am.
ACKNOWLEDGEMENT
We are overwhelmed in all humbleness
and greatness to acknowledge my debt
to all those who helped us to put these
ideas, well above the level of simplicity
and into something concrete. I would
like to express my special thanks of
gratitude to my teacher Mrs. R. Padma
Lakshmi ma’am who gave us this
wonderful opportunity to do this
innovative project. Any attempt at any
level can’t be satisfactorily completed
without our friend’s and family's
support and guidance. I would like to
thank all of them.
INDEX

• Overview Of Python
• Need for the Project
• Requirements
• Object Description
• Flow chart
• Source Code
• Output
• Shortcomings
• Bibliography
Overview Of Python

Python is an interpreter, object-oriented, high-


level programming language with dynamic
semantics. Its high-level built-in data
structures, combined with dynamic typing and
dynamic binding; make it very attractive for
Rapid Application Development, as well as for
use as a scripting or glue language to connect
existing components together. Python's simple,
easy-to-learn syntax emphasizes readability and
therefore reduces the cost of program
maintenance. Python supports modules and
packages, which encourages program modularity
and code reuse. The Python interpreter and the
extensive standard library are available in
source or binary form without charge for all
major platforms and can be freely distributed.
Need for the Project

This project is on “Operation On


Numbers”; it helps us to understand
the numbers better. This project is
developed in Python Language.
Various functions are used to make
complete use of this language. This
project helps us understand more
about the special types of numbers.
The user is provided with several
options which they can use to
perform the desired task.
REQUIREMENTS

The following are the requirements to


make this project on a laptop or
computer:
•Modern operating system (Windows
7 or above)
• x86 64-bit CPU (Intel Celeron/
AMD architecture)
• At least 2 GB RAM
• 2 GB free space on the hard drive.
• Latest version of python IDLE or
IDE available.
Apart from software and hardware
requirements, a basic understanding
and knowledge of Python are
required.
Object Description

•String: String in python is a sequence of


characters. It is an immutable data
type.
• List: List in python is the collection of
different data types in square brackets.
• Functions:
• Int: Integer data type represents
some range of mathematical integers.
• Append: Inserts a single element into
an existing list.
• Reverse: It is an inbuilt method in
the Python programming language
that reverses objects of the List in
place
FLOWCHART
SOURCE CODE
print(" ** WELCOME TO OPERATIONS ON NUMBERS **")
print(" Here you can enter a number and carry out
")
print(" various operations with it according to your choice.
")
print("\n** MENU **")
print(" Enter 1 to find out whether the entered number
is Prime number or not.")
print(" Enter 2 to find out the factorial of the entered
number.")
print(" Enter 3 to find out whether the entered number
is Armstrong number or not.")
print(" Enter 4 to find out whether the entered number
is Perfect number or not.")
print(" Enter 5 to find out whether the entered number
is Happy number or not.")
print(" Enter 6 to find out whether the entered number
is Automorphic number or not.")
print(" Enter 7 to find out whether the entered number
is Special number or not.")
print(" Enter 8 to find out the Binary equivalent of the
entered number.")
print(" Enter 9 to find out whether the entered number
is a magic number or not.")
print()
choice = int(input("Enter choice : "))
print()
n = int(input("Enter a number : "))
# Accepting number from the user.
# Prime Number.
if choice == 1:
# If number is greater than 1
if n > 1:
# Check if factor exist
for i in range(2,n):
if (n % i) == 0:
print(n,"is not a prime number")
break
else:
print(n,"is a prime number")

# Else if the input number is less than or


equal to 1
else:
print(n,"is not a prime number")
# Factorial of the number.
elif choice == 2:
f=1
for i in range(1,n+1):
f=f*i
print("Factorial of the number is :",f)

# 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

•Performance and speed


are slower.
• Error detection in source
code is mostly runtime
making, making it take
more time to debug if
any error is present.
•Some logical errors may
be present.
BIBLIOGRAPHY

•Useful guidance from


our computer teacher
Mrs. Jaya Chakraborty
ma’am.
•Computer Science
textbook of Std 11 by
Sunita Arora.
• www.google.com

You might also like