Assignment1: My First Python Notebook
This assignment will help you practice Python basics and Google Colab features. You will write
code, use markdown, and explore libraries in an organized Colab notebook.
1. Title & Introduction (Markdown)
- Add a title using `#`
- Write a short introduction (2-3 lines) about what the notebook will demonstrate
2. Basic Python Operations (Code Cells)
Tasks:
- Create variables of different types: integer, float, string, and list
- Perform and print:
- - Basic arithmetic operations
- - String concatenation and slicing
- - List operations (add, remove, sort)
3. Control Structures
- Write a loop to print numbers from 1 to 10
- Use a loop to print each character in a string
- Write an if-else block to check if a number is even or odd
4. Functions
- Write a function to return the square of a number
- Write a function that accepts a list and returns only even numbers
5. Text Cell Formatting (Markdown)
- Add a subheading using `##`
- Use **bold**, *italics*, and bullet points
- Write a math formula using LaTeX: e.g., `E = mc^2`
6. Installing and Importing Libraries
- Use `!pip install` to install a package like numpy or pandas
- Use `import` to load the library and demonstrate a basic usage:
Example:
import numpy as np
arr = np.array([1, 2, 3])
print(arr * 2)
7. Challenge Section (Optional)
- Count the number of vowels in a given string
- Find the largest number in a list without using built-in functions