Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
224 views

Programming For Everybody (Getting Started With Python) - Home - Coursera - 4 PDF

This document appears to be a quiz from an online Coursera course on Python programming. It contains 10 multiple choice questions testing knowledge of Python functions, including keywords for defining functions, ending code blocks, using arguments and return values, and benefits of defining your own functions. The student passed all 10 questions with full points.

Uploaded by

DeezNuts
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
224 views

Programming For Everybody (Getting Started With Python) - Home - Coursera - 4 PDF

This document appears to be a quiz from an online Coursera course on Python programming. It contains 10 multiple choice questions testing knowledge of Python functions, including keywords for defining functions, ending code blocks, using arguments and return values, and benefits of defining your own functions. The student passed all 10 questions with full points.

Uploaded by

DeezNuts
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

03/05/2019 Programming for Everybody (Getting Started with Python) - Home | Coursera

Chapter 4 10/10 points (100%)


Quiz, 10 questions

Congratulations! You passed! Next Item

1/1
 point

1. 
Which Python keyword indicates the start of a function de nition?

1/1
 point

2. 
In Python, how do you indicate the end of the block of code that makes up the function?

1/1
 point

3. 
In Python what is the input() feature best described as?

1/1
 point

4. 
What does the following code print out?

1 def thing():
2 print('Hello')
3
4 print('There')

1/1
 point

5. 

https://www.coursera.org/learn/python/exam/BZDBl/chapter-4 1/3
03/05/2019 Programming for Everybody (Getting Started with Python) - Home | Coursera

In the following Python code, which of the following is an "argument" to a function?


Chapter 4 10/10 points (100%)
Quiz, 10 questions
1 x = 'banana'
2 y = max(x)
3 z = y * 2

1/1
 point

6. 
What will the following Python code print out?

1 def func(x) :
2 print(x)
3
4 func(10)
5 func(20)

1/1
 point

7. 
Which line of the following Python program will never execute?

1 def stuff():
2 print('Hello')
3 return
4 print('World')
5
6 stuff()

1/1
 point

8. 
What will the following Python program print out?

1 def greet(lang):
2 if lang == 'es':
3 return 'Hola'
4 elif lang == 'fr':
5 return 'Bonjour'
6 else:
7 return 'Hello'
8
9 print(greet('fr'),'Michael')

1/1
 point

https://www.coursera.org/learn/python/exam/BZDBl/chapter-4 2/3
03/05/2019 Programming for Everybody (Getting Started with Python) - Home | Coursera

9. 
Chapter 4 the following Python code print out? (Note that this is a bit of a trick question and10/10
What does the code has
points (100%)
Quiz, 10 questions
what many would consider to be a aw/bug - so read carefully).

1 def addtwo(a, b):


2 added = a + b
3 return a
4
5 x = addtwo(2, 7)
6 print(x)

1/1
 point

10. 
What is the most important bene t of writing your own functions?

https://www.coursera.org/learn/python/exam/BZDBl/chapter-4 3/3

You might also like