0% found this document useful (0 votes)
3 views26 pages

Python Record File - Merged

The document is a project record file for a Computer Science project on String Operations submitted by Mayank, a student of 11th Science at Vidya Memorial Public School for the session 2025-26. It includes sections such as a certificate, acknowledgment, project introduction, hardware and software used, source code, and sample outputs. The project demonstrates various string operations using a poem stanza and includes multiple Python code examples for different functionalities.

Uploaded by

studentanshyadav
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)
3 views26 pages

Python Record File - Merged

The document is a project record file for a Computer Science project on String Operations submitted by Mayank, a student of 11th Science at Vidya Memorial Public School for the session 2025-26. It includes sections such as a certificate, acknowledgment, project introduction, hardware and software used, source code, and sample outputs. The project demonstrates various string operations using a poem stanza and includes multiple Python code examples for different functionalities.

Uploaded by

studentanshyadav
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

VIDYA MEMORIAL PUBLIC SCHOOL

ComputerScience
(Code–083)

Record File
Session(2025-26)

Submitted to: Mrs. Submitted by:

Mandeep Kaur Name : Mayank


Class : 11th Science

Roll No :1118
INDEX

S No. Description
1. Certificate
2. Acknowledgement
3. Introduction to the Project
4. Hardware and Software used
5. Poem Details
6. Project Source Code
7. Sample Outputs of Project
8. Bibliography
CERTIFICATE

This is to certify that Mayank of class 11th has


successfully completed the Computer Science
project
on String Operations (using Poem Stanza) under my
supervision in the computer lab of Vidya Memorial
Sr. Sec. Public School in the session 2025-26. The
work done by him is original.

Mandeep Kaur

Computer Science Teacher


ACKNOWLEDGEMENT
I would like to express my sincere thanks of gratitude
to my subject teacher Mrs. Mandeep Kaur for her vital
support, guidance and encouragement. She helped me
for completing the project by giving guidance, ideas
and made this project easy and accurate.

I would like to extend my gratitude to our principal


Mrs. Priya Tyagi who gave me the golden opportunity
to do this project and also providing me all the
facilities that was required.
I wish to thank my parents for their undivided support
and interest who inspired me and encouraged me to go
my own way, without which I would be unable to
complete my project.

Mayank
Introductionof the Project

The Project is based on String Operations


using a Poem Stanza. The main features of
project are:
1. Convert Stanza into List of Words
2. Show a Random Word from Stanza
3. Count Number of Words in Stanza
4. Count Words Begin with Vowel in Stanza
5. Count Digits, Symbols, Capital and Small
Letters in Stanza
Hardware and Software Used

Hardware Used
Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz
3.30 GHz
Installed RAM: 8.00 GB (7.89 GB usable)
Standard io devices like mouse, cpu,
keybord, etc

Software Used
Microsoft Window 10 as operating system.

Python IDLE as front end


development environment.
Microsoft Office Word for documentation.
Q Python record file:
1. Input a welcome message and display it:

Code

A=input("Enter a message")
print(A)
Output
2. Input two numbers and display the largest / smallest number.

Code

a=int(input('Enter a number'))
b=int(input('Enter a number'))
if a>b:
print("Larger number",a)
print("smaller number",b)
else:
print("Larger number",b)
print("smaller number",a)

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

Code

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


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

print("Largest number:", max(a, b, c))


print("Smallest number:", min(a, b, c))

Output
4 Generating series:

Code
print("Pattern 1")

for i in range(1,6):

for j in range(1,i+1):

print("*",end='')

print()

print("Pattern 2")

for i in range(5,0,-1):

for j in range(1,i+1):

print(j,end='')

print()

print("Pattern 3")

for i in range(1,6):

for j in range(1,i+1):

print(chr(j+64),end='')

print()

Output:
5.

Code:
x=int(input("Enter a number"))
n=int(input("Enter a number"))
sum=1
for i in range(1,n+1):
sum+=(x**i)/(i)
print(sum)

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


n= int(input("enter a number: "))
Sum = 1
for i in range(1,n+1):
if i%2== 0:
Sum+= (x**i)
else:
Sum+= -(x**i)
print(Sum)

Output:
6. Write a menu driven program to print: ( n is given by user.)
1. factorial series up to n.
2. even series up to n.
3. prime series up to n.

Code:

n=int(input("enter a number"))
print("1 for calculating factorial till the given no.")
print("2 for calculating even series till the given no.")
print("3 for prime series upto the given no.")
b=int(input("enter the menu choice"))
if b==1:
fac==1
for i in range(n+1):
fac*=i
print(fac)
elif b==2:
for i in range(n+1):
if i%2==0:
print(i)
elif b==3:
count=0
for i in range(2, n+1):
for j in range(2,i):
if i%j==0:
break
else:
print(i, end="")

Output:
7 #Determine whether a number is a perfect number, an Armstrong number or a palindrome, using
interactive menu.
Code:
n = int(input("Enter a number: "))
print("1 for finding if the no. is a perfect no.")
print("2 for finding if the no. is a armstrong no.")
print("3 for finding if the no. is a palindrome")

b = int(input("enter the menu choice: "))

if b == 1:
s=0
for i in range(1, n):
if n % i == 0:
s += i
if s == n:
print(n, "is a Perfect number.")
else:
print(n, "is NOT a Perfect number.")

elif b == 2:
s=0
t=n
ds = len(str(n))
for i in range(ds):
d = t % 10
s += d ** ds
t //= 10

if s == n:
print(n, "is an Armstrong number.")
else:
print(n, "is NOT an Armstrong number.")

elif b == 3:
if n == int(str(n)[::-1]):
print("Palindrome")
else:
print("Not Palindrome")

else:
print("the entered choice is invalid")

output:
8. Input a number and check if the number is a prime or composite number.

Code
n=int(input("Enter a number"))
count=0
for i in range(1,n+1):
if n%i==0:
count+=1
if count>2:
print("the no. is composite")
else:
print("the no. is prime")

Output
9. Display the n terms of a Fibonacci series, n is given by user. (hint : 0 1 1 2
3 5 8 13 21..)

Code:
n=int(input('Enter a number'))
a=0
b=1

for i in range(n):
print(a)
a, b = b, a + b

Output:
10. Compute the greatest common divisor and least common multiple of
two integers.

Codes
a=int(input('Enter a number'))
b=int(input('Enter a number'))
if a%b==0:
print('Least common multiple of both the terms is',a)
print('Greatest commmon divisor of both terms is',(a*b)/a)
elif b%a==0:
print('Least common multiple of both the terns is',b)
print('Greatest commmon divisor of both terms is',(a*b)/b)
else:
print('The least common multiple of both the terms is',a*b)
print('Greatest commmon divisor of both terms is',(a*b)/(a*b))

Output:
11. Write a menu driven interactive program to :
1. Count and display the number of vowels, consonants, uppercase,
lowercase characters in the given string.
2. Whether it is a palindrome or not.
3. Convert the case (lower to upper & vice versa) of characters of given
string.

Code:
n=input("Enter a string")
print('''1 to Count and display the number of vowels, consonants, uppercase,
lowercase characters in the given string.''')
print(" 2 to check whether it is a palindrome or not.")
print('''3 to convert the case (lower to upper & vice versa) of characters of given
string.''')
b=int(input("Enter your menu choice"))
if b==1:
v=0
c=0
u=0
l=0
vow="aeiouAEIOU"
for i in range(len(n)):
if n[i] in vow== True:
v+=1
if n[i].isupper==True:
u+=1
if n[i].islower== True:
l+=1
if n[i] in vow== False:
c+=1
print("NO. of vowels",v)
print("No. of consonants",c)
print("No. of lower case",l)
print("No. of upper case", u)
if b==2:
if n==n[::-1]:
print("The word is a palindrome")
else:
print("The word is not a palindrome")
if b==3:
r = ""
for i in range(len(n)):
if n[i].islower():
r += n[i].upper()
elif n[i].isupper():
r += n[i].lower()
else:
r += i

print("Converted string:", r )

Output:
12. interactive menu

Codes:
n=eval(input("Enter a list"))
print("1 Search an element")
print("2 largest and smallest element")
print("3 sum of all elements")
print("4 to terminate the program")
b=int(input("Enter a no."))
if b==1:
for i in range(len(n)):
a=int(input("Element to be searched"))
if n[i]== a:
print("The given element is at index",i)
if b==2:
print("the largest no.",max(n))
print("the smallest no.",min(n))
if b==3:
s=0
for i in range(len(n)):
s+=n[i]
print("sum of the elements is",s)
if b==4:
print("your program is succesfully terminated")

Output:
13. L=eval(input("Enter a List"))

if len(L)%2==0:

end=len(L)

else:

end=len(L)-1

print("Original List",L)

for i in range(0,end,2):

L[i],L[i+1]=L[i+1],L[i]

print("List after Swapping",L)

Output:
14. Write a menu driven program to do following operations on a tuple:

Codes:
n=eval(input("Enter a tuple"))
print("1 Search an element")
print("2 largest and smallest element")
print("3 sum of all elements")
print("4 to terminate the program")
b=int(input("Enter a no."))
if b==1:
a=int(input("Element to be searched"))
for i in range(len(n)):
if n[i]== a:
print("The given element is at index",i)
if b==2:
print("the largest no.",max(n))
print("the smallest no.",min(n))
if b==3:
s=0
for i in range(len(n)):
s+=n[i]
print("sum of the elements is",s)
if b==4:
print("your program is succesfully terminated")

Output:
15. create a dictionary students in a class and display the names of students who have
marks above 75.

for i in range(5):

print("Enter Details of student No.", i+1)

roll_no = int(input("Roll No: "))

std_name = input("Student Name: ")

marks = int(input("Marks: "))

result[roll_no] = [std_name, marks]

print("Dictionary with the details of 5 students")

print(result)

# Display names of students who have got marks more than 75

for student in result:

if result[student][1] > 75:

print("Student's name who get more than 75 marks is",(result[student][0]))

Output:

You might also like