- Create a simple Python program that asks the user to input two numbers and a mathematical operation (addition, subtraction, multiplication, or division).
- Perform the operation based on the user's input and print the result.
- Example: If a user inputs 10, 5, and +, your program should display 10 + 5 = 15.
-
- Create an empty list called my_list.
-
- Append the following elements to my_list: 10, 20, 30, 40.
-
- Insert the value 15 at the second position in the list.
-
- Extend my_list with another list: [50, 60, 70].
-
- Remove the last element from my_list.
-
- Sort my_list in ascending order.
-
- Find and print the index of the value 30 in my_list.
-
- Create a function named calculate_discount(price, discount_percent) that calculates the final price after applying a discount. The function should take the original price (price) and the discount percentage (discount_percent) as parameters. If the discount is 20% or higher, apply the discount; otherwise, return the original price.
-
- Using the calculate_discount function, prompt the user to enter the original price of an item and the discount percentage. Print the final price after applying the discount, or if no discount was applied, print the original price.
- File Read & Write Challenge 🖋️: Create a program that reads a file and writes a modified version to a new file.
- Error Handling Lab 🧪: Ask the user for a filename and handle errors if it doesn’t exist or can’t be read.
- Create a class representing anything you like (a Smartphone, Book, or even a Superhero!).
- Add attributes and methods to bring the class to life!
- Use constructors to initialize each object with unique values.
- Add an inheritance layer to explore polymorphism or encapsulation.
- Create a program that includes animals or vehicles with the same action (like move()). However, make each class define move() differently (for example, Car.move() prints "Driving" 🚗, while Plane.move() prints "Flying"
✈️ ).
- Choose a dataset in CSV format (for example, you can use datasets like the Iris dataset, a sales dataset, or any dataset of your choice).
- Load the dataset using pandas.
- Display the first few rows of the dataset using .head() to inspect the data.
- Explore the structure of the dataset by checking the data types and any missing values.
- Clean the dataset by either filling or dropping any missing values.
- Compute the basic statistics of the numerical columns (e.g., mean, median, standard deviation) using .describe().
- Perform groupings on a categorical column (for example, species, region, or department) and compute the mean of a numerical column for each group.
- Identify any patterns or interesting findings from your analysis.
- Create at least four different types of visualizations:
- Line chart showing trends over time (for example, a time-series of sales data).
- Bar chart showing the comparison of a numerical value across categories (e.g., average petal length per species).
- Histogram of a numerical column to understand its distribution.
- Scatter plot to visualize the relationship between two numerical columns (e.g., sepal length vs. petal length).
- Customize your plots with titles, labels for axes, and legends where necessary.