Chapter 4 (Quiz Answers) | Week-6 | Programming for Everybody (Getting Started with Python) By Coursera
- sweet
- def
- continue
- help
- You put the colon character (:) in the first column of a line
- You put the “END” keyword in column 7 of the line which is to be the last line of the function
- You de-indent a line of code to the same indent level as the def keyword
- You add a line that has at least 10 dashes
- A user-defined function
- The central processing unit
- A built-in function
- A conditional statement
def thing():
print('Hello')
print('There')
- thing
Hello
- Hello
- There
- def
thing
x = 'banana'
y = max(x)
z = y * 2
- x
- max
- ‘banana’
- y
def func(x) :
print(x)
func(10)
func(20)
- x
- x
- def
- 10
def stuff():
print('Hello')
return
print('World')
stuff()
- return
- print (‘World’)
- def stuff():
- print(‘Hello’)
- stuff()
def greet(lang):
if lang == 'es':
return 'Hola'
elif lang == 'fr':
return 'Bonjour'
else:
return 'Hello'
print(greet('fr'),'Michael')
- Bonjour Michael
- Hola Michael
- Hello Michael
- def
def addtwo(a, b):
added = a + b
return a
x = addtwo(2, 7)
print(x)
- 2
- 7
- 14
- 9
- Following the rule that no function can have more than 10 statements in it
- Following the rule that whenever a program is more than 10 lines you must use a function
- To avoid having more than 10 lines of sequential code without an indent or de-indent
- Avoiding writing the same non-trivial code more than once in your program
Do Not Only Use These Quizzes For Getting Certificates.You Can Take Help From These Quizzes Answer. All Quizzes & Contents Are Free Of Charge. ✅If You Want Any Quiz Answers Then Please Contact Us