CS Project Class 11th Python Programs
CS Project Class 11th Python Programs
Practical File
2021-22
Name : Sudhanshu
Class : XI – C
Subject : Computer Science
Submitted to : Saurabh Bhutani
Certif
This is to certify that
XI-C hasicate Sudhanshu of class
successfully
completed the project work on
Computer Science for class XI practical examination of the
Central Board of Secondary Education in the year 2021-22 . It is
further certified that this project is the individual work of the
candidate
Teacher Sign
Index
S No. Programs Dat Remarks
e
1. Write a program to display a Multiplication Table
of a number inputted by the user.
2. Write a program to input two numbers and
display the larger/smaller number
3. Write a program to determine whether a number
is an Armstrong number or not.
4. Write a program to determine whether a number
is a Perfect number or not
5. Write a program to determine whether a number
is a Palindrome Number or not
6. Write a program to input three numbers and
determine the greatest number
7. Write a program to determine whether a number
is prime or composite
8. Write a program to get the sum of this series 1 +
x + x**2 + x**3 + x**4 + ..... + x**n
9. Write a program to get the sum of this series 1 –
x + x**2 - x**3 + x**4 + ..... + x**n
10. Write a program to determine the sum of the
series x - x**2/2 + x**3/3 - x**4/4 + ........... +
x**n/n
11. Write a program to get the sum of the series x +
x**2/2! - x**3/3! + x**4/4! + ........... + x**n/n!
12. Write the program to print the Pattern 12345
1234
123
12
1
Running Code :
Input as 150
Output
Running Code :
Output
Running Code :
Input
Output
Ques 4. Write a program to determine whether a number is a Perfect
number or not.
Code :
Running Code :
Input
Ouput
Ques 5. Write a program to determine whether a number is a Palindrome
Number or not.
Code :
Running Code :
Input
Output
Ques 6. Write a program to input three numbers and determine the
greatest number.
Code :
Output
Input
Output
Ques 7. Write a program to determine whether a number is prime or
composite.
Code :
Running Code :
Input
Output
Ques 8. Write a program to get the sum of this series 1 + x + x**2 + x**3 +
x**4 + ..... + x**n .
Code :
Running Code :
Input
Output
Ques 9. Write a program to get the sum of this series 1 – x + x**2 - x**3 +
x**4 + ..... + x**n .
Code :
Running Code :
Input
Output
Ques 10. Write a program to determine the sum of the series x - x**2/2 +
x**3/3 - x**4/4 + ........... + x**n/n.
Code :
Running Code :
Input
Output
Ques 11. Write a program to get the sum of the series x + x**2/2! - x**3/3! +
x**4/4! + ........... + x**n/n! .
Code :
Running Code :
Input
Output
Ques 12. Write the program to print the Pattern 12345
1234
123
12
1
Code :
Running Code:
Input
Output
Ques 13. Write a program to print the pattern *
**
***
****
*****
Code :
Running Code :
Input
Output
Ques 14. Write a program to determine the greatest common divisor and
least common multiple.
Code :
gcd=0
for i in range(1,n1) : # finding th Greatest common divisor
if n1 % i == 0 and n2 % i == 0 :
gcd = i
lcm = n1*n2/gcd # finding the Least common multiple
Running Code :
Input
Output
Ques 15. Write a program to determine how many vowels, consonants,
uppercase, and lowercase are present in the text.
Code :
Running Code :
Input Output
Ques 16. Display the terms of the Fibonacci series.
Code :
Running Code :
Input
Output
Ques 17. Input a string and determine whether it is a palindrome or not.
Code:
Running Code :
Input
Output
Ques 18. Convert the case of characters in a string.
Code :
Running Code :
Input
Output
Ques 19. Write a program to print the pattern A
AB
ABC
ABCD
ABCDE
Code :
for i in range(1,n+1):
a = 65 #ord of A is 65
for j in range(1,i+1) :
print(chr(a),end='')
a+=1
print()
Running Code :
Input
Output
Ques 20. Convert Celsius to Fahrenheit or visa versa.
Code :
if n == 1: # convert it
c = int(input('Enter temperature in Celsius : '))
f = 9*c/5+32
print('Temperature in Fahrenheit is ',f,'°F')
elif n == 2 :
f = int(input('Enter Temperature in Fahrenheit : '))
c = 5/9*(f - 32)
print('Temperature in Celsius is ',c,'°C')
else:
print('It seem to be that you have entered wrong input')
Running Code :
Input
Output
Ques 21. Write a program which tells about how many alphabets, digit,
lowercase and uppercase characters are present in a sentence.
Code :
alpha = 0
digit = 0
lower = 0
upper = 0
for i in txt : # check how following things are present
if i.isalpha() :
alpha += 1
elif i.isdigit() :
digit +=1
if i.islower() :
lower+=1
if i.isupper():
upper+=1
print('there are the following in the sentence :')
print('Alphabet : ',alpha)
print('Digit : ',digit)
print('lowercase : ',lower)
print('Uppercase : ',upper)
print('The lenght of the sentence is : ',len(txt))
Running Code :
Input
Output
Ques 22. Write a program to remove all the vowels from the sentence or
string.
Code :
str1 = ''
Running Code :
Input
Output