-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpractice7.py
More file actions
20 lines (19 loc) · 751 Bytes
/
practice7.py
File metadata and controls
20 lines (19 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""
3-10. Every Function: Think of something you could store in a list. For example,
you could make a list of mountains, rivers, countries, cities, languages, or any-
thing else you’d like. Write a program that creates a list containing these items
and then uses each function introduced in this chapter at least once.
"""
#3-10
good_countries = ['New Zealand','Japon','Germany','UK']
print("Original list : ",good_countries)
print("Sorted list temp :", sorted(good_countries))
good_countries.reverse()
print("Reversed list : ", good_countries)
print(len(good_countries))
test = good_countries[:]
print("Copy list : ",test)
test.pop(1)
print("Using pop to delete an item : " ,test)
test.append("Canada")
print("add a new element with append",test)