List of Programs Done

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

List of programs done in PPS Lab

1. Demonstrate use of integer types and operators that can be used on them.

Program # use of integer types

print(3 / 4) print(3*4)

print(3 % 4)

print(3 // 4)

print(3 ** 4)

2. Evaluate following expressions by initializing a = 10 ; b = 25 ; c = 15 ; d = 30 ; e = 2 ; f =


3;g=5

w=a+b–c

x = d ** e

y=f%g

print(w, x, y)

3 Demonstrate use of complex and bool types and operators that can be used on them.

# use of complex

a = 1 + 2j

b = 3 *(1 + 2j)

c=a*b

print(a)

print(b)

print(c)

print(a.real)

print(a.imag)

print(a.conjugate( ))

print(a)
# use of bool

x = True

y=3>4

print(x)

print(y)

4.Write a program that makes use of functions in the math module.

import math

x=8

print ( math.pi, math.e)

print(math.sqrt( x))

print(math.factorial(6))

print(math.fabs(x))

print(math.log(x))

print(math.log10(x))

print(math.exp(x))

5. Python program for Hello World.

6. Python program to add Two Numbers.

7. Python program to subtract two numbers.


8. Python Program to Multiply Two numbers.
9. Python program for Division Operations.
10. Python program to print Calendar.
11. Python program to find Cube of a Number
12 Python program to swap two variables using third variable.
13 Print “Best WishesBest Wishes”
X="Best" y="Wishes" print ( (x+y) *2)
14 Find circumference and area of circle.
15 Find perimeter and area of rectangle and square.
16 Write a program to convert temperature from degree centigrade to Fahrenheit. °F = °C*1.8+32
17 Write a program to find sum and average of marks of 4 subjects.
18 Write a program to accept number of hours from user and display the following
Total Amount = No of hours * Charges per hour
GST=18% of Total Amount
Amount Due=Total Amount + GST
19 Write a program to print the sum of digits of a 3 digit number.
20 Write a program to find real root of a quadratic equation.
Ax2+bx+c=0
21Python program to find Largest of 2 Numbers.

22Python program to check whether input number is Odd or Even.

23 Python program to check whether input year is Leap Year or not.


24 Python program to check whether person is eligible for giving vote or not.
25Python program to check whether input number is positive or negative.
26 Python program to check whether input numbers are equal or not.

27While purchasing certain items, a discount of 10% is offered if the quantity purchased is
more than 1000. If quantity and price per item are input through the keyboard, write a
program to calculate the total expenses.
28 Python program to check Number Divisible by 5.
29 Check whether figure is triangle or not by entering three angles from keyboard.
30 An event organizer company needs to organize an event for 100 people. Accept the length
and breadth of the hall. Calculate area and display message based on following criteria.
Area Message display
>=10000 suitable for event
<10000 not suitable

31 Percentage marks obtained by a student are input through the keyboard. The student gets a
division as per the following rules:
Percentage above or equal to 60 - First division
Percentage between 50 and 59 - Second division
Percentage between 40 and 49 - Third division
Percentage less than 40 – Fail
Write a program to calculate the division obtained by the student using if-elif-else and
logical operators.

32 Find Largest of three numbers.

33 If the three sides of a triangle are entered through the keyboard, write a program to
check whether the triangle is valid or not. The triangle is valid if the sum of two sides is
greater than the largest of the three sides.

34A year is entered through the keyboard, write a program to determine whether the year
is leap or not. Use the logical operators and and or.
If year % 4 = 0 and year % 100!= 0 or year%400 == 0:

Print leap year

35 If the three sides of a triangle are entered through the keyboard, write a program to check
whether the triangle is isosceles, equilateral,scalene or right angled triangle.

You might also like