Practice More Questions From: Quiz 5 – Lists & Strings
Q:
What is the correct way to select the third element in a list called ‘my_list’?
Q:
What’s the result of the following code? lst = [1, 2, 3] lst.append(3) lst.pop() print(lst)
Q:
What will be the result of the following code? lst = [1, 2, 3] lst.append(3) lst.pop(0) print(lst)
Q:
What will be the result of the following code? for i in range(5): print(i)
Q:
What will be the result of the following code? myList = [‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’, ‘g’, ‘h’] print(myList[6:8])
Subscribe
0 Comments