-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlist practice.py
More file actions
26 lines (25 loc) · 1023 Bytes
/
list practice.py
File metadata and controls
26 lines (25 loc) · 1023 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
friends = ["zoobel" , "carnation" ,"was" , "not" , "in" , "the" , "history"]
print(friends[0])
print(friends.append("But Why It Is In This Ancient Book."))
print(friends)
sample_list = [1, 2,6,7,3,67,472345]
sample_list.sort()
print(sample_list)
sample_list.insert(4, 345)
print("so the final list is :-")
sample_list.sort()
print(sample_list)
choice = input("\033[32m Y IF YOU WANT TO REMOVE A VALUE or N IF YOU DON'T WANT TO AND IF YOU WRITE ANY THING ELSE I ...I.. YOU DON'T WANA KNOW\033[0m")
if choice.lower() == "y":
value_to_remove = int(input("Enter the value you want to remove from the list: "))
if value_to_remove in sample_list:
sample_list.remove(value_to_remove)
print(f"{value_to_remove} has been removed. The updated list is: {sample_list}")
else:
print(f"{value_to_remove} is not in the list.")
else:
print("SOO... YOU ARE AN IDIOT RASKALE HOW WANT TO PLAY GAMES DAMN YOU!")
#
list = [1, 2, 3, 67, 345]
a, b, *remaininglist = list
print(a, b, *remaininglist)