Assignment
1. What is programming? Why do we use Python for programming? (Short answer)
2. Write steps to set up Python on your computer and run your first program.
3. Write a Python program to print the following text:
Hello, Python Learner!
Welcome to the world of programming.
4. Write a program that prints your name, age, and city using three separate print()
statements.
5. Create a program that includes one single-line and one multi-line comment.
6. Declare three variables x, y, and z. Assign values 5, 10, and 15 to them, then print their
sum and average.
7. Write a program that calculates the area of a rectangle using variables length and
width.
Formula: area = length * width
8. Define the following data types in Python:
o Integer
o Float
o String
o Boolean
9. Write a program that takes an integer input from the user and converts it into a float. Print
both values.
10. Write a program that takes two numbers from the user and displays:
o Their sum
o Their difference
o Their product
o Their quotient
11. Write a program to check if one number is greater than, less than, or equal to another
number.
12. Store your name in a variable name and perform the following:
o Print the first character of your name.
o Print the last character of your name.
o Print the first three characters using slicing.