0% found this document useful (0 votes)
339 views3 pages

Congratulations! You Passed!: Chapter 6 Quiz

This document summarizes a 10 question quiz on Python data structures and strings from an online Coursera course. It shows the user's correct answers to multiple choice and code snippet questions testing string manipulation skills like concatenation, slicing, indexing, and common string methods. All questions were answered correctly, with the user scoring a perfect 10 out of 10 on the quiz.

Uploaded by

DeezNuts
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
339 views3 pages

Congratulations! You Passed!: Chapter 6 Quiz

This document summarizes a 10 question quiz on Python data structures and strings from an online Coursera course. It shows the user's correct answers to multiple choice and code snippet questions testing string manipulation skills like concatenation, slicing, indexing, and common string methods. All questions were answered correctly, with the user scoring a perfect 10 out of 10 on the quiz.

Uploaded by

DeezNuts
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 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 marquard@uct.ac.za'

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 marquard@uct.ac.za'

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 stephen.marquard@uct.ac.za 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