-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhobbies.py
More file actions
26 lines (20 loc) · 791 Bytes
/
hobbies.py
File metadata and controls
26 lines (20 loc) · 791 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
hobbies = ["dancing", "singing", "painting"]
# ~ print("I like " + hobbies[0].title())
# ~ print("I like " + hobbies[1].title())
# ~ vehicles = ["car", "bike", "plane"]
# ~ print("I would like to own a " + vehicles[0] + "\nbut right now i just have a " + vehicles[1])
# ~ hobbies.append("eating") #to add to the list
# ~ print(hobbies)
# ~ hobbies.insert(1, "sleeping") #inserting at an index
# ~ print(hobbies)
# ~ del hobbies[0]
# ~ print(hobbies) #deleting from an index
popped_item = hobbies.pop() #pop the last item
print(hobbies)
print(popped_item)
new_pop = hobbies.pop(0) #pop from an index
print(new_pop)
skin_care = ["cream", "sheet masks", "body wash", "scrub"]
too_expensive = "sheet masks"
skin_care.remove(too_expensive) #removing an item directly
print(skin_care)