Professional Documents
Culture Documents
2 Rotated
2 Rotated
2 Rotated
Objectives :
Pre-Lab: Go through the concepts of variables, keywords, constants, logical and arithmetic
operators, decision making and loops in Python. Write the algorithm and flowchart for the
exercise given in the handout.
During the Lab : Solve all exercise problems and get your observations signed.
Lab Exercies
1. Write a program that uses at least three variables, one keyword, and one constant.
2. Identify and correct any syntax errors in the following code:
my_variable = 10
for = 5
constant = 3.14
3. Write a program to display a welcome message.
4. Write a program to display your name and age.
5. Write a program to read the name and age from the user and display.
6. Write a program to read two numbers from the user and perform all arithmetic operations.
7. Write a program to calculate the following
a. The area of a rectangle
b. The volume of a cylinder
c. The Circumference of a circle
d. Convert temperature from Celsius to Fahrenheit
e. Convert distance from kilometers to miles
8. Write a Python program to determine whether a given number is positive, negative, or
zero.
9. Write a Python program to determine whether a given year is a leap year.
(A year is a leap year if divisible by 4, except for years divisible by 100 but not by 400.)
10. Write a program to find the largest of two numbers. (also the smallest).
11. Write a program to find the largest of three numbers. (also the smallest).
12. Write a program to find the sum of all numbers from 1 to n.
13. Write a program to display the multiplication table of a given number using a for loop.
14. Write a program to find the factorial of a given number.
15. Write a program to generate Fibonacci series up to n terms.