0% found this document useful (0 votes)
19 views

Programming Using Python Practicals

Uploaded by

syalkamya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Programming Using Python Practicals

Uploaded by

syalkamya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Programming using Python

1) Write a Python program to check whether the given number is even number or odd
number.
2) Write a Python to find the biggest number from the given 2 numbers using built-in
function and if statement.
3) Write a Python to find the biggest number from the given 3 numbers using built-in
function and nested if statement.
4) Write a Python program to print the first N natural number.
5) Write a Python program to print all the natural numbers till N.
6) Write a Python program to print the first N natural odd number using while and for
loop.
7) Write a Python program to print the first N natural even number using while and for
loop.
8) Write a Python program to check whether the given year is leap year or not.
9) WAP to add N natural numbers and display their sum
10) Write a Python program to display the factorial of the given N number.
11) Write a Python program to swap 2 numbers in a single statement.
12) Write a Python program to find the roots of the quadratic equation.
13) Write a Python to calculate the total marks, percentage and grade of a student. Marks
obtained in each of the three subjects are to be input by the user. Assign grades
according to the following criteria:
Grade A: if Percentage >= 80
Grade B: if Percentage >= 60 and Percentage < 80
Grade C: if Percentage >= 40 and Percentage < 60
Grade D: if Percentage < 40
14) Write a Python that takes a positive integer n and then produce n lines of output:
*
* * *
* * * * *
* * * * * * * (sample output for n=4)
15) Write a Python that takes a positive integer n and then produce n lines of output:
* * * *
* * *
* *
* (sample output for n=4)
16) Write a Python that takes a positive integer n and then produce n lines of output:
1
1 2 1
1 2 3 2 1
1 2 3 4 3 2 1 (sample output for n=4)
17) WAP to print Fibonacci series till the given number N. (eg. 1,1,2,3,5,8,13 for n=7)
18) Write a Python program to print the first N prime number.
19) Write a Python program to print all the prime numbers till N.
20) WAP to print the following conversion table (use Loop constructs):
Height (in Feet) Height (in Inches)
5.0 ft 60 inches
5.1 ft 61.2 inches
…. ….
6.0 ft 72 inches

21) W.A.P to print the sum of squares of first N numbers.


22) W.A.P to calculate the compound interest.
23) W.A.P to print armstrong numbers. (Example: 153=1^3+5^3+3^3)
24) W.A.P to convert given temperature from Farenheit to Celcius.
25) W.A.P to convert time in minutes to time in hours and minutes. (Example: 136
minutes:- 2 hours 16 minutes)
26) W.A.P to reverse the numbers using % and //.
27) W.A.P to calculate area and perimeter of a triangle.
28) W.A.P to calculate grade for the marks as per DU guidelines.
29) W.A.P to read the radius of a sphere from the user and calculate the volume of the
sphere. (NOTE: volume of sphere=4/3*3.14*r³)
30) Write a menu-driven python program to ask the user to choose the sphere, cylinder,
cube, cuboid and display the area of the respective shapes.
31) Write a Python program that takes the name and age of a person as input and displays
an appropriate message whether the person is eligible to vote or not based on age
where minimum age for voting is 18 years.
32) Write a Python that takes a positive integer n and then produce n lines of output:
4
3 4
2 3 4
1 2 3 4 (sample output for n=4)
33) WAP to find the sum and average of the positive numbers entered by the user. As soon
as the user enters a negative number, stop taking in any further input from user and
display the sum and average.
34) WAP that reads a number in feet, converts it to meters, and display the result. One
foot=0.305 meters.
35) WAP to find the minimum and maximum of the numbers entered by the user. As soon
as the user enters a ‘-999’, stop taking in any further input from user and display the
minimum and maximum.
36) WAP to search a particular element in the numbers entered by the user. As soon as the
user enters a ‘-999’, stop taking in any further input from user and display whether the
search element is available in the given numbers.
37) WAP to display the largest factor of a positive number entered by the user.
38) WAP to find whether the given number is palindrome or not without the built-in rev()
function.
39) WAP to find the sum of the series: 1 -4 +9 -16 +25 …. till the given number N.
40) WAP to find the sum of the series: 1! +2! +3! +4! +5! …. till the given number N.

You might also like