0 of 20 Questions completed
Questions:
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
0 of 20 Questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
2. How can you add an item to the end of a list in Python?
3. What method is used to remove the last item of a list?
4. Which of the following creates a list with elements 1, 2, 3?
5. How do you access the first element of a list?
6. What does the following list comprehension produce? [x for x in range(5)]
7. Which list comprehension would create a list of the squares of the numbers 1 through 5?
8. What does the following list comprehension produce? [x for x in range(10) if x % 2 == 0]
9. Which of these is a correct list comprehension to create a list of the first letters of each word in a list of words?
10. True or False: List comprehensions can include conditional statements.
11. How do you get the last three elements of a list?
12.What does list[1:3]
return if list = [10, 20, 30, 40, 50]
?
13. list[::-1]
returns the list in reverse order.
14. How do you create a tuple with a single item in Python?
15. Which of the following is a correct way to create an empty tuple?
16. Tuples can contain elements of different data types.
17. How do you sort a list in ascending order?
18. How do you sort a list in descending order?
19. Which operator is used to concatenate two lists?
20. How do you add all elements of list b
to the end of list a
?