Solved

Which of the Following Statements Is False

Question 13

Multiple Choice

Which of the following statements is false?


A) Each function should perform a single, well-defined task.
B) The following code calls function square twice. We've replaced each of the output values with ???. The first call produces the int value 49 and the second call produces the int value 6: In [1]: def square(number) :
) ..: """Calculate the square of number."""
) ..: return number ** 2
) ..:
In [2]: square(7)
Out[2]: ???
In [3]: square(2.5)
Out[3]: ???
C) The statements defining a xe "function"function are written only once, but may be called "to do their job" from many points in a program and as often as you like.
D) Calling square with a non-numeric argument like 'hello' causes a TypeError because the exponentiation operator (**) works only with numeric values.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents