0% found this document useful (0 votes)
6 views38 pages

Python Program Pratical Cs

The document is a practical file for a Python programming course, listing 37 programming exercises. These exercises cover a range of topics including calculations, string manipulation, and control structures. Each task requires students to write a Python program to solve specific problems or perform certain operations.

Uploaded by

deepikasanjay4
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)
6 views38 pages

Python Program Pratical Cs

The document is a practical file for a Python programming course, listing 37 programming exercises. These exercises cover a range of topics including calculations, string manipulation, and control structures. Each task requires students to write a Python program to solve specific problems or perform certain operations.

Uploaded by

deepikasanjay4
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

PYTHON PROGRAM

PRATICAL FILE
FOR
[Link]
1. Write a program that accepts the radius of
a circle and prints its area.
2. Write a program that inputs a student’s
marks in three subjects (out of 100) and
prints the percentage marks.
[Link] a program to calculate simple
interest.
[Link] a program to read two numbers and
prints their quotient and reminder.
5. Write a program to find whether a given
number is even or odd.
6. Write a program to find the largest
among the three integers.
7. Write a program that accepts weight in Kg
and height in meters and calculate the BMI.
8. Write a program to accept the marks of five
subjects and calculate the average marks.
9. Write a program to accept the height in cm
and convert it into feet and inches.
10. Write a program that accepts the age and print
if one is eligible to vote or not.
11. Write a program that accepts two numbers and check
if the first number is fully divisible by the second number
or not.
12. Write a program to read base, width and height of
parallelogram and calculate its area and perimeter.
13. Write a program to accept the year and check if it is a
leap year or not.
14. Write a program to obtain x, y, z and calculate
4x´+3y³+9z+6π.
15. Write a program to input a number and print its
square if it is odd, otherwise print its square root.
16. Write a program to input a number and check
whether it is positive, negative or zero.
17. Write a program to input percentage marks of a
student and find the grade as per the following criterion:
Marks Grade >=90 A 75-90 B 60-75 C Below 60 D
18. Write a program to display a menu for calculating the
area of the circle or perimeter of the circle.
19. Write a program to print whether a given character is
an uppercase or a lowercase character or a digit or any
other character.
20. Write a program to find the factorial of a given
number using a loop.
21. Write a program to print the following pattern using
loops: * ** *** **** *****
22. Write a program to find the sum of digits of a given
number using a loop.
23. Write a program to find the greatest common divisor
(GCD) of two numbers using a loop.
24. Write a program to print the following pattern: 1 12
123 1234 12345
25. Write a program to print all prime numbers between
1 and 50.
26. Write a program to find sum of series : s=1+x+x ²+x
³+x ´…+x ⁿ
27.. Write a python script to calculate the sum of the
following series: S=(1)+(1+2)+(1+2+3)+……+(1+2+3+….+n)
28. Write a python code to input a string and display all
the vowels present in it. Sample input: COMPUTER
Sample output: O U E
29. Write a python code to input a string in lowercase
replace the letter E with *symbol in the given string.
Display the new string.
30. Write a python code to input a string and change the
case of each letter upper case to lowercase and vice
versa. Display the new string Sample Input: WeLcOME tO
python LanGuAGe Sample output: wElCome To PYTHON
lANgUagE.
31. Write a python code to input a string and check
whether it is a palindrome string or not. (A word is said
to be the palindrome if it is a reads the same after
reversing the letter) Sample Input: madam Sample
Output: madam A ward is a palindrome
[Link] a python code to input a string convert into
uppercase and display the string in alphabetical order of
its letters. Simple Input: computer Simple Output:
CEMOPRTU
[Link] a program code to input a sentence in the lowercase.
Convert the first letter of each word of the sentence in
uppercase and display the new sentence. Simple Input: we are
learning python language Simple Output: We Are Learning
Python Language
[Link] a python code to input a sentence in the
lowercase. Enter a word separately and find the
frequency of the given word in the sentence. Finally,
display the frequency of the ward. Sample Input: the
quick brown fox jumps over the lazy dog. Word to be
searched: the Sample output: frequency of word ‘the’=2
[Link] a program that reads a line by user and prints
its statistics like: Number of uppercase letters Number of
Lowercase letters Number of alphabets Number of digits
36. Write a program that enter a string and display the
string without vowel characters. Sample Input: the quick
brown fox jumps over the lazy dog. Sample output: th
qck brwn fx jmps ver th lzy dg.
37. Write a program that enter a string and
display the alternate characters in a string.
Simple Input: computer Simple Output: cmue

You might also like