1
0

initial file upload

This commit is contained in:
mlot
2025-05-09 10:12:44 -04:00
parent 61bf543133
commit 40e9918df0
22 changed files with 215 additions and 1 deletions

28
chap3/motorcycles.py Normal file
View File

@@ -0,0 +1,28 @@
motorcycles = ['honda', 'yamaha', 'suzuki']
print(motorcycles)
motorcycles.append('honda')
motorcycles[0] = 'ducati'
print(motorcycles)
motorcycles.insert(0, 'harley')
print(motorcycles)
del motorcycles[0]
print(motorcycles)
popped_motorcycle = motorcycles.pop()
print(motorcycles)
print(popped_motorcycle)
print(f"The last motocycle I owned was a {popped_motorcycle.title()}.")
first_owned = motorcycles.pop(0)
print(f"The first motorcyle I owned was a {first_owned.title()}.")
motorcycles.remove('suzuki')
print(motorcycles)
too_expensive = 'yamaha'
motorcycles.remove(too_expensive)
print(f"{too_expensive.title()} is too expensive for me!")