Create a list that contains another list
Create a list and another list inside the current list, next create two methods first create empty list collect how many cities from the list you want to keep it from beginning, depending one your choice. Second method do the same but ask you how citeies you want to drop show only what is left in the cities list.
The number you enter determines how many items are kept or dropped.
py [keep_drop_in_list.py](http://keep_drop_in_list.py/)
City list: [55, 'London', 'Berlin', ['a', 'b', 3, 4], 'New York', 'Paris', 'Rome', 'Oslo']
Enter the number of above cities you want to keep it: 3
Pick first cities: [55, 'London', 'Berlin']
====== ====== ====== ====== ====== ====== ====== ======Β
City list: [55, 'London', 'Berlin', ['a', 'b', 3, 4], 'New York', 'Paris', 'Rome', 'Oslo']
Enter the number of cities above you want to drop it: 5
Drop cities: ['Paris', 'Rome', 'Oslo']
Activate to view larger image,
0 Comments
Leave a comment
No comments yet. Be the first to share your thoughts!