Introductory Programs
1. Write a python program to print data type of integer, float, complex, list, set, tuple,
dictionary using type() predefined function.
2. Write a python program to find the number of characters in a string (Use len()
predefined function)
3. Write a python program to find the number of characters in a list, set and tuple (Use
len() predefined function)
4. Write a python program to read an integer from the keyboard (Use input() and int()
predefined functions)
5. Write a python program to read radius of circle as float value from the keyboard and
print the area and circumference of the circle. (Use input() and float() predefined
functions)
6. Write a python program to read the length and breadth of rectangle as float values
from the keyboard and print the area, perimeter of rectangle. (Use input() and float()
predefined functions)
7. Write a python program to read the side of a square as input from the keyboard and
print the area and perimeter of the square. (Use input() and int() predefined functions)
8. Write a python program to read temperature in degrees F and convert to degrees
Celsius (Use input() and float() predefined functions)
9. Write a python program to read distance in Km and convert to miles (Use input() and
float() predefined functions)
10. Write a python program to calculate area of right-angled triangle by taking base and
height as inputs (Use input() and float() predefined functions)
11. Write a python program to calculate area of triangle by taking length of all 3 sides as
inputs (Use input() and float() predefined functions and math.sqrt() function)
Use input() predefined function for all the below programs
12. Demonstrate the following Operators in Python with suitable examples.
i) Arithmetic Operators
ii) Relational/Comparison Operators
iii) Assignment Operator (and Augmented/Short-hand Assignment
Operators)
iv) Logical Operators
v) Bit wise Operators
vi) Membership Operators
vii) Identity Operators [LAB 1.4]
13. Write a python program to swap 2 numbers using temporary variable.
14. Write a python program to swap 2 numbers without using temporary variable
(Use +, - operators) [LAB 1.3]
15. Write a python program to swap 2 numbers without using temporary variable (Use
*, // operators)
16. Write a python program to swap 2 numbers using Multiple assignment. [LAB
1.3]
17. Write a python program to perform addition, subtraction, multiplication of
complex numbers [LAB 1.5]
Conditional Statements
18. Write a python program to check whether a number is positive or negative (if else)
19. Write a python program to check whether a number is zero or positive or negative
(elif)
20. Write a python program to check whether a person is eligible to vote or not. (if else)
21. Write a python program to check to find the largest of 2 numbers (if else)
22. Write a python program to check to find the smallest of 2 numbers (if else)
23. Write a python program to check to find the largest of 3 numbers (elif) [LAB
1.1]
24. Write a python program to check to find the smallest of 3 numbers (elif)
25. Write a python program to check to find the largest of 4 numbers (elif)
26. Write a python program to check to find the smallest of 4 numbers (elif)
27. Write a python program to print the corresponding day of the week (elif)
28. Write a python program to print the corresponding month of the year (elif)
29. Write a python program to check whether given number is even or odd (if else)
30. Write a python program to check whether given number is divisible by 7 or not (if
else)
31. Write a python program to find the largest among 3 numbers (nested if else)
32. Write a python program to print Grade based on marks:
Marks<40 Fail
40<=Marks<50 Grade D
50<=Marks<60 Grade C
60<=Marks<70 Grade B
70<=Marks<80 Grade B+
80<=Marks<90 Grade A
90<=Marks<95 Grade A+
95<=Marks<=100 Grade O
33. Write a python program to print whether of the day based on temperature:
Temp<0 Chilling
0<=Temp<10 Very Cold
10<=Temp<18 Cold
18<=Temp<25 Average
25<=Temp<35 Warm
35<=Temp<40 Hot
40<=Temp<50 Very Hot
Temp>=50 Extremely hot