-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path18.py
More file actions
37 lines (24 loc) · 680 Bytes
/
18.py
File metadata and controls
37 lines (24 loc) · 680 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
# create a list
movies = []
movies.append('The Holy Grail')
movies.append('THe Life of Brain')
movies.append('The Meaning of Life')
print(movies)
year_list = [1975, 1979, 1983]
k = 0
for i in range(1, len(movies) + len(year_list), 2):
movies.insert(i, year_list[k])
k += 1
movies = movies[:2]
print(movies)
movies_cast = ['Michael Palin', 'John Cleese', 'Terry Gilliam', 'Eric Idle', 'Terry Jones']
director = ['Graham Chapman']
movies_cast.append(director)
movies.append(movies_cast)
print(movies)
for obj in movies:
if type(obj) == list:
print(obj)
for obj1 in obj:
if type(obj1) == list:
print(obj1)