I love to solve problems around me through codes and an Influencer (I know,I see myself that way).I believe programming is powerful and you can do whatever
I love to solve problems around me through codes and an Influencer (I know,I see myself that way).I believe programming is powerful and you can do whatever
You are right, when we simply use Pop() without specifying the item position,It removes the last item and returns the value which has been removed
languages = ['java', 'python' ,'perl', 'ruby', 'c#']
print(languages.pop()) # returns c#, the last index
print(languages) # print the after removing c#
# output ['java', 'python', 'perl', 'ruby']
Thanks
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Nice intro! I think you had a couple typos though
Then,
You have an index in the first one too.
I was also surprised you didn't give the output for the last methods you showed.
Nice writing otherwise keep it up
Thank you for that observation,I will edit the post soon enough
I understand the misunderstanding on extend() method and I have used a more clear example by defining a second list
You are right, when we simply use Pop() without specifying the item position,It removes the last item and returns the value which has been removed
Thanks