Python Programming Assignment
### Python Programming Assignment
#### Objective:
This assignment is designed to help you practice basic Python programming concepts such as
variables, loops, conditionals, functions, and file handling.
### Part 1: Basic Python Syntax
1. Write a Python script that asks the user for their name and age, then prints a message saying
"Hello, [name]! You are [age] years old."
### Part 2: Conditional Statements
2. Write a Python program that takes an integer as input and prints whether the number is even or
odd.
### Part 3: Loops
3. Write a Python program that prints the numbers from 1 to 10 using a for loop.
### Part 4: Functions
4. Define a function called `calculate_area` that takes two parameters (length and width) and returns
the area of a rectangle.
### Part 5: File Handling
5. Write a Python program that creates a text file called "sample.txt", writes "Hello, Python!" to it, and
then reads and prints the content.
Page 1
Python Programming Assignment
### Bonus Challenge (Optional):
6. Write a Python program that takes a list of numbers and returns a new list with only the even
numbers.
#### Submission Guidelines:
- Save all your code in a single Python script (.py file).
- Ensure your script is well-commented.
- Submit the script as a .zip file.
Happy Coding!
Page 2