Basic Python Practice Sheet
Basic Python Practice Sheet
2. Conditional Statements
3. Loops
4. Functions
- Write a function `greet(name)` that takes a name as input and prints a greeting message.
- Create a function to find the factorial of a given number.
- Create a list of five fruits and print each one using a `for` loop.
- Write a program to find the largest number in a given list.
6. File Handling
- Write a Python program to create a text file, write some content into it, and read the content.
7. Practice Challenge
- Write a program that takes a list of numbers as input and returns a new list with only the even
numbers.