-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmotorcycles.py
41 lines (28 loc) · 938 Bytes
/
motorcycles.py
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
motorcycles = ["honda", "yamaha", "suzuki"]
print(motorcycles)
motorcycles[0] = "ducati"
print(motorcycles)
motorcycles.append('honda')
print(motorcycles)
motorcycles.insert(0, 'ducati_2')
print(motorcycles)
del motorcycles[0]
print(motorcycles)
popped_motorcycle = motorcycles.pop()
print(motorcycles)
print(popped_motorcycle)
motorcycles = ["honda", "yamaha", "suzuki"]
last_owned = motorcycles.pop()
first_owned = motorcycles.pop(0).title()
print("The last motorcycle I owned was a " + last_owned.title() + ".")
print("The first motorcycle I owned was a " + first_owned + ".")
motorcycles = ["honda", "yamaha", "suzuki", "ducati"]
motorcycles.remove("suzuki")
print(motorcycles)
motorcycles = ["honda", "yamaha", "suzuki", "ducati"]
too_expensive = "ducati"
motorcycles.remove(too_expensive)
print(motorcycles)
print(motorcycles)
print("\nA " + too_expensive.title() + " is too expensive for me.")
print(motorcycles[-1])