# The pop function, without an input, defaults to removing
# and returning the last item in a list.
myList = [1, 2, 3, 4, 5]
myList.pop()
print(myList)
# You can also do this without returning the last item, but it is
# much more complicated.
myList = [1, 2, 3, 4, 5]
myList.remove(myList[len(myList)-1])
print(myList)
# 3 ways to remove last element from list python
# program to delete the last
# last element from the list
#using pop method
list = [1,2,3,4,5]
print("Original list: " +str(list))
# call the pop function
# ele stores the element
#popped (5 in this case)
ele= list.pop()
# print the updated list
print("Updated list: " +str(list))
# slice the list
# from index 0 to -1
list = list[ : -1]
# print the updated list
print("Updated list: " +str(list))
# call del operator
del list[-1]
# print the updated list
print("Updated list: " +str(list))
from time import time
q = input('What do you want to type? ')
a = ' '
record = []
while a != '':
start = time()
a = input('Type: ')
end = time()
v = end-start
record.append(v)
if a == q:
print('Time taken to type name: {:.2f}'.format(v))
else:
break
for i in record:
print('{:.2f} seconds.'.format(i))