You are on page 1of 11

A

Project Report On
Python Programming
Subject: Computer Science
2022-2023
Name: Rhea Shingote
Class: 11th Science
Roll no: 31 Exam Seat no:
CERTIFICATE

This is to certify Rhea shingote of Class XI Science of Air Force


School, 9BRD Chandan Nagar, Pune has completed her project
file under my supervision. She has taken proper care and shown
utmost sincerity in completion of this project. I certify this
project is up to my expectation as per the guidelines issued by
CBSE.

Subject Teacher’s Examiner’s Principal’s


Sign Sign Sign
ACKNOWLEDGEMENT

I sincerely wish to thank our Principal Mrs. Garima Goel for


providing all the necessary resources without which it would not
have been possible to complete this project. I am extremely
thankful and pay my gratitude to my Computer Science teacher
Mrs. Shivangini Shrivastava for providing me with the
opportunity to do this wonderful project and for her valuable
guidance and support for the completion of this project in due
time. I would also like to extend my thanks to my parents and
friends who helped me a lot in finalizing this project within the
stipulated time period.

Rhea Shingote
XI Science
Index

Sr no. Title Page no.

Input a welcome
1. message and display 6
it.
Input two numbers
and display the
2. 6
larger/smaller
number.
Input three numbers
and display the
3. 6
largest/smallest
number.

Determine whether a
number is a perfect
4. number, an 7-8
Armstrong number
or a palindrome.

5. Input a number and 8


check if the number
is a prime or
composite number.

Display the terms of


6. 9
the Fibonacci series.
Compute the
greatest common
7. divisor and least 9
common multiple of
the two integers.
Count and display
the number of
vowels, consonants,
8. 10
uppercase,
lowercase characters
in string.

Python programming

1. Input a welcome message and display it.

a=str (input ("enter welcome message:"))


print ("hello,", a)
2. Input two number and display the larger/smaller number.

a=int (input ("enter first number:"))


b=int (input ("enter second number:"))

if (a>b):
print (a, "is the greater number")
else:
print (b, "is the greater number")

3. Input three numbers and display the largest/smallest number.

a=int (input ("enter first number:"))


b=int (input ("enter second number:"))
c=int (input ("enter third number:"))

if (a>b) and (a>c):


largest=a
elif (b>a) and (b>c):
largest=b
else:
largest=c

print ("the largest number is",largest)


4. Determine whether a number is a perfect number, an Armstrong
number or a palindrome.

a. Perfect number.

a=int (input ("enter number:"))


sum=0

for r in range(1,a):
if a%r==0:
sum=sum+r

if sum==a:
print ("number is a perfect number")

else:
print ("number is not a perfect number")

b. Armstrong number.

a=int (input ("enter number:"))


sum=0
order=len(str(a))
copy_a=a

while (a>0):
digit=a%10
sum+=digit**order
a=a//10

if (sum==copy_a):
print ("number is an Armstrong number")

else:
print ("number is not an Armstrong number")
c. Palindrome.

a=int (input ("enter number:"))


reverse=0
copy_a=a

while (a>0):
digit=a%10
reverse=reverse*10+digit
a=a//10

if (copy_a==reverse):
print("number is a palindrome")

else:
print("number is not a palindrome")

5. Input a number and check if it is a prime or composite number.

a=int (input ("enter number:"))

if a==1:
print ("number is not prime or composite")

for r in range (2,a):


if a%r==0:
print ("number is composite")

break

else:
print ("number is prime")

6. Display the terms of Fibonacci series.

a=int (input ("enter how many terms of Fibonacci series:"))

x=0
y=1

print ("Fibonacci series is:")


print (x,",",y,end=",")
for i in range (2,a):
next=x+y
print(next,end=",")
x=y
y=next

7. Compute the greatest common divisor and least common multiple of


two integers.

x=int (input ("enter first number:"))


y=int (input ("enter second number:"))

if x>y:
smaller=y
else:
smaller=x
for i in range(1,smaller+1):
if((x%i==0) and (y%i==0)):
hcf=i

lcm=(x*y)/hcf
print ("the hcf of " ,x, "and " ,y, "is " ,hcf)
print ("the lcm of " ,x, "and " ,y, "is " ,lcm)

8. Count and display the number of vowels, consonants, uppercase,


lowercase characters in string.

a = input ("Enter any string :")


vowel = consonant = uppercase = lowercase= 0
for i in a:
if (i == 'a' or i == 'e' or i == 'i' or i == 'o' or i == 'u'or i == 'A' or i == 'E'
or i == 'I' or i == 'O' or i == 'U'):
vowel = vowel +1
else:
consonant = consonant + 1
if i.isupper() :
uppercase = uppercase + 1

if i.islower():
lowercase = lowercase + 1

print ("Total number of vowel:",vowel)


print ("Total number of consonant:",consonant)
print ("Total number of uppercase letter:",uppercase)
print ("Total number of lowercase letter:",lowercase)
THANK
YOU

You might also like