Professional Documents
Culture Documents
NAME :
CLASS :
Python - Lists, Dictionaries and Loops
DATE :
36 Questions
1. list[a:b] will return the portion of list starting with index a and
ending before index b.
a) True b) False
c) 3 d) 4
a) 6 b) 1
c) pants d) "pants": 6
https://quizizz.com/print/quiz/5e0dbf3bbdc0e1001c511941 1/7
2/14/2020 Python - Lists, Dictionaries and Loops | Print - Quizizz
7. Fill in the blank so that print_list(x) prints every other item in list
x:
a) [6] b) [1, 8, 6, 4, 2]
c) [8, 6, 4, 2, 1] d) [8, 4, 2]
a) [1, 3, 5] b) [3]
c) [1, 5, 7] d) [1, 3, 7]
10. How many lines will the code below print to the console?
a) 4 b) 5
c) 2 d) 3
a) It creates pairs of elements when passed b) It creates pairs of elements when passed two
integers lists
a) index() b) enumerate()
c) itemize() d) track()
https://quizizz.com/print/quiz/5e0dbf3bbdc0e1001c511941 2/7
2/14/2020 Python - Lists, Dictionaries and Loops | Print - Quizizz
13. Which of the following is the correct way to create the following
list of names: 'Tom', 'Jerry', 'Tweetie', 'Sylvester'?
a) b)
c) d)
a) Yes, lists can contain multiple data types. b) No, lists can only contain one data type.
a) list(9) b) list(range(10))
a) b)
c) d)
a) empty_list = [] b) empty_list = {}
18. Which of the following would create a range object that starts
at 3, goes up to but not including 15 where each number is 4
greater than the previous number?
19. Which of the following is the correct way to add the number 4
to mylist?
a) mylist + 4 b) mylist.append(4)
c) mylist.append([4]) d) 4.append(mylist)
20. Which of the following lines of code would select the list ['b', 'c']
from mylist:
a) mylist[1:3] b) mylist[1,3]
c) mylist[1,2] d) mylist[1:2]
https://quizizz.com/print/quiz/5e0dbf3bbdc0e1001c511941 3/7
2/14/2020 Python - Lists, Dictionaries and Loops | Print - Quizizz
21. Which of the following lines of code will correctly sort mylist?
a) mylist.sorted() b) sort(mylist)
c) mylist.sort d) mylist.sort()
23. Which of the following commands will return the length of the
list mylist?
a) length(mylist) b) len(mylist)
c) mylist.length() d) mylist.len()
24. Which of the following lines of code would select the letter d
from mylist:
a) mylist[4] b) mylist{4}
c) mylist[3] d) mylist(3)
a) 0 1 2 3 4 b) 3 3 3 3 3
c) 5 5 5 d) 0 1 2
27. Fill in the blank with the appropriate while condition in order to
print the numbers 1 through 10 in order:
https://quizizz.com/print/quiz/5e0dbf3bbdc0e1001c511941 4/7
2/14/2020 Python - Lists, Dictionaries and Loops | Print - Quizizz
a) i i i i b) 1 2 3
c) 0 1 2 d) i i i
a) 1 1 2 3 b) 2
c) 1 1 d) 1 1 3
a) b)
a) b)
c) d)
https://quizizz.com/print/quiz/5e0dbf3bbdc0e1001c511941 5/7
2/14/2020 Python - Lists, Dictionaries and Loops | Print - Quizizz
a) b)
c) d)
a) "soda" b) KeyError
c) ["veggie burger", "salad", "soda"] d) ["hamburger", "fries", "soda"]
https://quizizz.com/print/quiz/5e0dbf3bbdc0e1001c511941 6/7
2/14/2020 Python - Lists, Dictionaries and Loops | Print - Quizizz
Answer Key
1. a 10. c 19. b 28. c
2. b 11. b 20. a 29. c
3. a 12. b 21. d 30. d
4. a 13. c 22. c 31. b
5. d 14. a 23. b 32. a
6. c 15. c 24. c 33. a
7. c 16. a 25. a 34. d
8. d 17. a 26. c 35. d
9. c 18. a 27. c 36. c
https://quizizz.com/print/quiz/5e0dbf3bbdc0e1001c511941 7/7