that does not explicitly return any value?

What is the default return value for a function that does not explicitly return any value?A . int B. void C. None D. Null E. publicView AnswerAnswer: C Explanation: Topic: return Try it yourself: def func1(): pass print(func1()) # None def func2(): return print(func2()) # None If a function does...

April 25, 2023 No Comments READ MORE +

The result of the following addition:

The result of the following addition: 123 + 0.0A . cannot be evaluated B. is equal to 123.0 C. is equal to 123View AnswerAnswer: B Explanation: Topics: addition operator integer float Try it yourself: print(123 + 0.0) # 123.0 If you have an arithmetic operation with a float, the result...

April 25, 2023 No Comments READ MORE +

What is the expected output of the following code?

What is the expected output of the following code? def func(num): res = '*' for _ in range(num): res += res return res for x in func(2): print(x, end='')A . ** B. The code is erroneous. C. * D. ****View AnswerAnswer: D Explanation: Topics: def return for Try it yourself:...

April 25, 2023 No Comments READ MORE +

What should you insert instead of XXX, YYY and ZZZ?

The ABC organics company needs a simple program that their call center will use to enter survey data for a new coffee variety. The program must accept input and return the average rating based on a five-star scale. The output must be rounded to two decimal places. You need to...

April 24, 2023 No Comments READ MORE +

Python is an example of:

Python is an example of:A . a machine language B. a high-level programming language C. a natural languageView AnswerAnswer: B Explanation: Topic: high-level programming language https://en.wikipedia.org/wiki/Python_(programming_language)

April 24, 2023 No Comments READ MORE +

What do you call a tool that lets you lanch your code step-by-step and inspect it at each moment of execution?

What do you call a tool that lets you lanch your code step-by-step and inspect it at each moment of execution?A . A debugger B. An editor C. A consoleView AnswerAnswer: A Explanation: Topic: debugger https://en.wikipedia.org/wiki/Debugger

April 23, 2023 No Comments READ MORE +

Which of the following lines correctly invoke the function defined below:

Which of the following lines correctly invoke the function defined below: def fun(a, b, c=0): # Body of the function. (Select two answers)A . fun(0, 1, 2) B. fun(b=0, a=0) C. fun(b=1) D. fun()View AnswerAnswer: A,B Explanation: Topics: functions positional parameters keyword parameters Try it yourself: def fun(a, b, c=0):...

April 23, 2023 No Comments READ MORE +

What is the expected output of the following code?

What is the expected output of the following code? print(list('hello'))A . None of the above. B. hello C. [h, e, l, l, o] D. ['h', 'e', 'l', 'l', 'o'] E. ['h' 'e' 'l' 'l' 'o']View AnswerAnswer: D Explanation: Topic: list() Try it yourself: print(list('hello')) # ['h', 'e', 'l', 'l', 'o']...

April 23, 2023 No Comments READ MORE +

Which of the following for loops would output the below number pattern?

Which of the following for loops would output the below number pattern? 11111 22222 33333 44444 55555A . for i in range(0, 5): print(str(i) * 5) B. for i in range(1, 6): print(str(i) * 5) C. for i in range(1, 6): print(i, i, i, i, i) D. for i in...

April 22, 2023 No Comments READ MORE +

What is CPython?

What is CPython?A . It' a programming language that is a superset of the C language, B. designed to produce Python-like performance with code written in C C. It' a programming language that is a superset of the Python, D. designed to produce C-like performance with code written in Python...

April 21, 2023 No Comments READ MORE +