forked from github/dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path02_Variables.py
More file actions
39 lines (34 loc) · 775 Bytes
/
02_Variables.py
File metadata and controls
39 lines (34 loc) · 775 Bytes
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
#Strings
first_name = "Rakesh"
print(first_name)
print(f"Hello {first_name}")
last_name = "Tiwarekar"
print(f"My name is {first_name} {last_name}")
#Integers
age = 40
print(age)
print(f"You are {age} years old")
quantity = 3
print(f"You are buying {quantity} items")
num_of_students = 20
print(f"Your class has {num_of_students} students")
#Float
price = 19.99
print(f"The price is ${price}")
gpa = 3.5
print(f"Your GPA is {gpa}")
distance = 5.5
print(f"The distance is {distance} kilometers")
#Boolean
is_student = True
print(f"Are you a student? {is_student}")
is_teacher = False
if is_student:
print("You are a student")
else:
print("You are not a student")
is_online = True
if is_online:
print("You are online")
else:
print("You are offline")