-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbeatles.py
More file actions
43 lines (33 loc) · 848 Bytes
/
Copy pathbeatles.py
File metadata and controls
43 lines (33 loc) · 848 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
40
41
42
43
# step 1
beatles = []
print("Step 1:", beatles)
print()
# step 2
beatles.append("John Lennon")
beatles.append("Paul McCartney")
beatles.append("George Harrison")
print()
print("Step 2:", beatles)
# step 3
for i in beatles:
add_beatle = input("Add Stu Sutcliffe to the band: ")
beatles.append(add_beatle)
add_beatle2 = input("Good. Now add Pete Best: ")
beatles.append(add_beatle2)
break
print("Step 3 - this is how the band looks now: ", beatles)
print()
# step 4
print("Now, let's remove these members.")
del beatles[-1]
del beatles[-1]
print("Step 4:", beatles)
# step 5
print()
print("Now, last but not least, we add Ringo to the band.")
r_star = "Ringo Star"
beatles.insert(0, r_star)
print()
print("Step 5:", beatles)
# testing list legth
print("The Fab", len(beatles))