Python Practice Questions - Lesson 1 Recap
1. Simple Variable Task
Create 3 variables: name, age, and is_student.
Assign your name, your age, and whether you're a student (True or False).
Then print them in a sentence using f-strings.
Example:
My name is Abdulrahman, I am 20 years old, and student status: True
2. Identify Data Types
Ask the user to input their age and height.
Then print the data type of each one using the type() function.
3. Conversion Practice
Write a program that asks the user to enter their birth year.
Then calculate their age and print it.
Example: If user enters 2005, output: You are 19 years old.
4. Multiple Inputs + Type Casting
Ask the user for their name, score out of 100, and if they passed (yes/no).
Print everything in a formatted string using f-strings.
Make sure the score is treated as a float.
5. Challenging One - BMI Calculator
Ask for a person's weight (kg) and height (m), then calculate and print their BMI.
Formula: BMI = weight / (height ** 2)
You can cover BMI meaning in the next class.