List of Programs Done
List of Programs Done
List of Programs Done
1. Demonstrate use of integer types and operators that can be used on them.
print(3 / 4) print(3*4)
print(3 % 4)
print(3 // 4)
print(3 ** 4)
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)
import math
x=8
print(math.sqrt( x))
print(math.factorial(6))
print(math.fabs(x))
print(math.log(x))
print(math.log10(x))
print(math.exp(x))
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.
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:
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.