-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththe_beatles.py
More file actions
55 lines (37 loc) · 1.43 KB
/
Copy paththe_beatles.py
File metadata and controls
55 lines (37 loc) · 1.43 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
# step 1
# First, we create an empty list.
beatles = []
print("Step 1:", beatles)
print("Looks pretty empty. Let's add some members to it.")
# step 2
# Append the names of the Beatles to the Beatlest list using the append() method.
beatles_members1 = input("Add John Lennon: ")
beatles.append(beatles_members1)
beatles_members2 = input("Add Paul McCartney: ")
beatles.append(beatles_members2)
beatles_members3 = input("Add George Harrison: ")
beatles.append(beatles_members3)
print("Step 2:", beatles)
# step 3
print("Okay, we aren't done here. Add Stu SutCliffe and Pete Best to the band.")
for _ in range(2):
old_beatles1 = input("Add one, and then the other: ")
beatles.append(old_beatles1)
print("Step 3:", beatles)
# step 4
print("Now, those guys left the band, so let's get rid of them.")
remove_stu = input("Remove Stu Sutcliffe from the band. ")
beatles.remove(remove_stu)
remove_stu = input("Remove Pete Best from the band. ")
beatles.remove(remove_stu)
print("Step 4:", beatles)
# step 5
print("Now, we have to add the great Ringo to the band. ")
add_ringo = input("Go ahead and add Ringo Starr: ")
# The first argument is the element location in the list.
beatles.insert(3, add_ringo)
print("Step 5:", beatles)
# testing list legth
print("Now, we have the complete Beatles. The one, the only!")
print("The Fab", len(beatles))
print("I hope you're happy, Greg!")