-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlists.py
More file actions
39 lines (27 loc) · 748 Bytes
/
lists.py
File metadata and controls
39 lines (27 loc) · 748 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
car_names = ["Ford", "Mustang", "Audi", "Tesla", "Marcedes", "Audi"]
heights = [1.2, 1.1, 0.6, 0.5, 1, True, False]
if len(car_names) > 6:
print("Length is greater than 6")
else:
print("Length is not greater than 6")
# print(len(car_names))
# print(len(heights))
# # append -> Adds an element at the end of the list
# car_names.append("Toyota")
# print(car_names)
# print(car_names.index("Audi"))
# print(car_names[0:2])
for x in car_names:
print(x)
for i in range(0, 50):
if
num = 3
if num > 3:
print(num, "is greater than 0")
print("The first statement executes")
elif num == 3:
print(num, "is equal to 3")
elif num > 5:
print(num, "is equal to 3")
else:
print(num, "is not greater than 0")