Aditya

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

DR.

KN MODI GLOBAL SCHOOL


MODINAGAR

COMPUTER SCIENCE
PYTHON PROGRAMS
PROJECT FILE
CLASS 11th

SUBMITTED BY:- SUBMITTED TO:-


Aditya gupta MR Avlokan Mohan
ACKNOWLEDGEMENT

I WOULD LIKE TO EXPRESS MY SPECIAL


THANKS OF GRATITUDE TO MY TEACHER
MR AVLOKAN MOHAN WHO GAVE ME
THE GOLDEN OPPORTUNITY TO DO THIS
WONDERFUL PROJECT OF COMPUTER
SCIENCE AND HELPED ME WITH HIS
GUIDANCE TO COMPLETE THIS
PROJECT ON PYTHON PROGRAMS
SUCCESSFULLY.I CAME TO KNOW ABOUT
SO MANY NEW THINGS I AM REALLY
THANKFUL TO THEM . SECONDLY I
WOULD LIKE TO THANK MY PARENTS
AND FRIENDS WHO HELPED ME A LOT IN
FINALIZING THIS PROJECT WITHIN THE
LIMITED TIME FRAME.

ADITYA GUPTA

CERTIFICATE
This is to certify that the project is titled
PYTHON PROGRAMS .This project is
submitted by ADITYA GUPTA of class
11th has successfully completed the
COMPUTER SCIENCE Project under the
guidance of MR AVLOKAN MOHAN.

AVLOKAN MOHAN ADITYA GUPTA


INDEX
1• Count and display the number of
vowels, consonants, uppercase,
lowercase characters in string.
2• Input a string and determine whether it
is a palindrome or not; convert the case
of characters in a string
3• Find the largest/smallest number in a
list/tuple
4• Input a list of numbers and swap
elements at the even location with the
elements at the odd location
5• Input a list/tuple of elements, search
for a given element in the list/tuple
6• Input a list of numbers and find the
smallest and largest number from the
list
7• Create a dictionary with the roll
number, name and marks of n students in a
class and display the names of students
who have scored marks above 75.
1.Count and display the number of
vowels, consonants, uppercase,
lowercase characters in string.

s = input("Enter any string :")


vowel = consonent = uppercase = lowercase= 0
for i in s:
if i in "AEIOUaeiou":
vowel = vowel +1
else:
consonent = consonent + 1
if i.isupper() :
uppercase = uppercase + 1

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

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


print("Total number of consonent:",consonent)
print("Total number of uppercase letter:",uppercase)
print("Total number of lowercase letter:",lowercase)
OUTPUT SCREEN:-
2• Input a string and determine whether it
is a palindrome or not; convert the case of
characters in a string
s = input("Enter any string :")
a = -1
temp = 0
for i in s:
if i != s[a]:
temp = 1
break
a=a-1
if temp == 1:
print("This string is not palindrome")
else:
print("This string is palindrome")
case = s.swapcase()
print("String after converting the case
of each character :",case)
OUTPUT SCREEN:-
3.Find the largest/smallest number in
a list/tuple
L=[]
while True:
num=int(input("Enter a Number:"))
L.append(num)
choice=input("Do you wish to continue?
[y/n]:")
if choice in 'Nn':
break
print(L)
print("Largest number in the list is :", max(L))
print("Smallest number in the list is :", min(L))
OUTPUT SCREEN:-
4. Input a list of numbers and swap
elements at the even location with the
elements at the odd location
L=[]
while True:
num=int(input("Enter a Number: "))
L.append(num)
choice=input("Do you wish to continue?
[y/n]")
if choice in 'Nn':
break
print("List before Swapping :",L)
s=len(L)
for i in range(0,s,2):
temp1=L[i]
temp2=L[i+1]
L[i]=temp2
L[i+1]=temp1
print("List after Swapping:",L)
OUTPUT SCREEN:-
5.Input a list/tuple of elements, search
for a given element in the list/tuple

a=eval(input("Enter List/Tuple:"))
found=0
num=int(input("Enter number to search:"))
for i in a:
if i==num:
found=1
break
if found==1:
print("Number is Found")
else:
print("Number is not found")

OUTPUT SCREEN:-
6. Input a list of numbers and find the
smallest and largest number from the
list

L=[]
while True:
num=int(input("Enter a Number:"))
L.append(num)
choice=input("Do you wish to continue?
[y/n]:")
if choice in 'Nn':
break
print(L)
print("Largest Number is:",max(L))
print("Smallest Numbe is:",min(L))
OUTPUT SCREEN:-
7.Create a dictionary with the roll
number, name and marks of n
students in a class and display the
names of students who have scored
marks above 75.

n=int(input("Enter Number of Students: "))


result= {}
for i in range(n):
R_no = int(input("Enter Roll No :"))
name = input("Enter Name: ")
marks= int(input("Enter Marks: "))
result[R_no]=[name,marks]
print(result)
for i in result:
if result[i][1]>75:
print("Name:", result[i][0], "\n",
"Marks:", result[i][1])
OUTPUT SCREEN:-

You might also like