-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariables-datatypes.py
More file actions
55 lines (37 loc) · 1.72 KB
/
variables-datatypes.py
File metadata and controls
55 lines (37 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
## 🏷️ **3. Variables and Data Types (15 mins)**
### ✅ **Common Data Types:**
# - **String (`str`)**: Text, `"Hello"` 📝
# - **Integer (`int`)**: Whole numbers, `42` 🔢
# - **Float (`float`)**: Decimals, `3.14` 💧
# - **Boolean (`bool`)**: True/False, `True` ✔️
#------------------------------------------------
name = "Bubbles" # String 📝
age = 45 # Integer 🔢
salary = 55000.50 # Float 💧
is_developer = True # Boolean ✔️
print(f"{name} is {age} years old and earns ${salary}. Developer: {is_developer}")
#------------------------------------------------
### 🛠️ **Student Activity:**
# - Create variables for:
# - Your favorite programming language. 💻
# - Your dream job title. 🌟
# - Print them using an f-string. 🖨️
#------------------------------------------------
print("🏷️ **3. Variables and Data Types (15 mins)**")
print("### ✅ **Common Data Types:**")
print("- **String (`str`)**: Text, \"Hello\" 📝")
print("- **Integer (`int`)**: Whole numbers, `42` 🔢")
print("- **Float (`float`)**: Decimals, `3.14` 💧")
print("- **Boolean (`bool`)**: True/False, `True` ✔️")
print("------------------------------------------------")
name = "Bubbles" # String 📝
age = 45 # Integer 🔢
salary = 55000.50 # Float 💧
is_developer = True # Boolean ✔️
print(f"{name} is {age} years old and earns ${salary}. Developer: {is_developer}")
print("------------------------------------------------")
print("### 🛠️ **Student Activity:**")
print("- Create variables for:")
print(" - Your favorite programming language. 💻")
print(" - Your dream job title. 🌟")
print("- Print them using an f-string. 🖨️")