Tuesday, July 24, 2018

Python Data Structures - Chapter 8 Quiz

Chapter 8 Quiz

Quiz, 10 questions
Question 1
1
point

1. Question 1

How are "collection" variables different from normal variables?
Question 2
1
point

2. Question 2

What are the Python keywords used to construct a loop to iterate through a list?
Question 3
1
point

3. Question 3

For the following list, how would you print out 'Sally'?
1
friends = [ 'Joseph', 'Glenn', 'Sally' ]
Question 4
1
point

4. Question 4

What would the following Python code print out?
1
2
3
fruit = 'Banana'
fruit[0] = 'b'
print(fruit)
Question 5
1
point

5. Question 5

Which of the following Python statements would print out the length of a list stored in the variable data?
Question 6
1
point

6. Question 6

What type of data is produced when you call the range() function?
1
x = range(5)
Question 7
1
point

7. Question 7

What does the following Python code print out?
1
2
3
4
a = [1, 2, 3]
b = [4, 5, 6]
c = a + b
print(len(c))
Question 8
1
point

8. Question 8

Which of the following slicing operations will produce the list [12, 3]?
1
t = [9, 41, 12, 3, 74, 15]
Question 9
1
point

9. Question 9

What list method adds a new item to the end of an existing list?
Question 10
1
point

10. Question 10

What will the following Python code print out?
1
2
3
friends = [ 'Joseph', 'Glenn', 'Sally' ]
friends.sort()
print(friends[0])

1 comment: