Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeMartinRince authored Dec 20, 2024
1 parent 5f3e971 commit 9e4a0ff
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions Day-23/joe.m.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
"""
AUTHOR : JOE MARTIN RINCE
"""


my_list = [10, 20, 30, 40]
print("Starting List")
print(my_list)



my_list.append(50)
print("\nAfter append(50):")
print(my_list)

my_list.extend([60, 70])
print("\nAfter extend([60, 70]):")
print(my_list)

my_list.insert(2, 25)
print("\nAfter insert(2, 25):")
print(my_list)

my_list.remove(30)
print("\nAfter remove(30):")
print(my_list)

removed_element = my_list.pop(3)
print("\nAfter pop(3):")
print(my_list)
print(f"(Removed element: {removed_element})")

index_of_50 = my_list.index(50)
print("\nIndex of 50:")
print(index_of_50)

count_of_20 = my_list.count(20)
print("\nCount of 20:")
print(count_of_20)

my_list.reverse()
print("\nAfter reverse():")
print(my_list)

my_list.sort()
print("\nAfter sort():")
print(my_list)

my_list.clear()
print("\nAfter clear():")
print(my_list)



0 comments on commit 9e4a0ff

Please sign in to comment.