-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVariables.py
More file actions
59 lines (44 loc) · 1.12 KB
/
Variables.py
File metadata and controls
59 lines (44 loc) · 1.12 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
56
57
58
59
#Variables - A container for a value (string, integer,float,boolean).
#A variable behaves as if it was the value it contains.
#String Variable
first_name = "Bro"
food = "shawarma"
email = "sharwarmaBro@fake.com"
print(first_name)
#insert variation
print(f"Hello {first_name}")
print(f"I like {food}")
print(f"My email is: {email}")
#Integer Variables
age = 29
quantity = 7
num_of_students = 77
#inset variation
print(f"I am {age} years old")
print(f"You age buying {quantity}")
print(f"The number of studetns are {num_of_students}")
#Floating Numbers
price = 11.99
gpa = 3.2
distance = 7.7
#insert varation
print(f"The price is $ {price}")
print(f"Your gpa is {gpa}")
print(f"You ran {distance}km")
#Boolean
is_student = True
for_sale = True
if_online = False
#insert variation
if is_student:
print("You are a student")
else:
print("You are not a Student")
if for_sale:
print("This item is for sale")
else:
print("This item is not availabe")
if if_online:
print("You are online")
else:
print("You're offline please check your network")