Congratulations! You Passed!: Chapter 6 Quiz

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

03/05/2019 Python Data Structures - Home | Coursera

Chapter 6 Quiz 10/10 points (100%)


Quiz, 10 questions

Congratulations! You passed! Next Item

1/1
 point

1. 
What does the following Python Program print out?

1 str1 = "Hello"
2 str2 = 'there'
3 bob = str1 + str2
4 print(bob)

1/1
 point

2. 
What does the following Python program print out?

1 x = '40'
2 y = int(x) + 2
3 print(y)

1/1
 point

3. 
How would you use the index operator [] to print out the letter q from the following string?

1 x = 'From [email protected]'

1/1
 point

4. 

https://www.coursera.org/learn/python-data/exam/y85mg/chapter-6-quiz 1/3
03/05/2019 Python Data Structures - Home | Coursera

How would you use string slicing [:] to print out 'uct' from the following string?
Chapter 6 Quiz 10/10 points (100%)
Quiz, 10 questions
1 x = 'From [email protected]'

1/1
 point

5. 
What is the iteration variable in the following Python code?

1 for letter in 'banana' :


2 print(letter)

1/1
 point

6. 
What does the following Python code print out?

1 print(len('banana')*7)

1/1
 point

7. 
How would you print out the following variable in all upper case in Python?

1 greet = 'Hello Bob'

1/1
 point

8. 
Which of the following is not a valid string method in Python?

1/1
 point
https://www.coursera.org/learn/python-data/exam/y85mg/chapter-6-quiz 2/3
03/05/2019 Python Data Structures - Home | Coursera

Chapter
9.  6 Quiz 10/10 points (100%)
What
Quiz, 10 will the following Python code print out?
questions

1 data = 'From [email protected] Sat Jan 5 09:14:16 2008'


2 pos = data.find('.')
3 print(data[pos:pos+3])

1/1
 point

10. 
Which of the following string methods removes whitespace from both the beginning and end of a string?

https://www.coursera.org/learn/python-data/exam/y85mg/chapter-6-quiz 3/3

You might also like