-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlist.py
More file actions
26 lines (23 loc) · 922 Bytes
/
Copy pathlist.py
File metadata and controls
26 lines (23 loc) · 922 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
justice_league = ["Superman", "Batman", "WonderWoman", "Flash", "Aquaman", "Green Lantern"]
#tasks 1
print("Number of members in Justice league",len(justice_league))
#2
justice_league.append("Batgirl")
justice_league.append("NightWing")
print("After adding Batgirl and Nightwing:", justice_league)
#3
justice_league.remove("WonderWoman")
justice_league.insert(0,"WonderWoman")
print("After making Wonder woman as a leader:",justice_league)
#4
justice_league.remove("Green Lantern")
aquaman_index = justice_league.index("Aquaman")
justice_league.insert(aquaman_index, "Green Lantern")
print("After separating Aquaman and Flash:", justice_league)
#5
justice_league=["Cyborg","Shazam","Hawkgirl","MartianManhunter","Green Arrow"]
print("New Justice league:",justice_league)
#6
justice_league.sort()
print("Sorted Justice League:",justice_league)
print("New Leader(0th index):",justice_league[0])