courses=['History', 'Maths', 'ML', 'Physics', 'CompSci']

popped=courses.pop()
#pop method also return the popped element so that we can store it in another varible

print(popped)
print(courses)

'''
Output:
CompSci
['History', 'Maths', 'ML', 'Physics']
'''

