What is the expected output of the following code?
What is the expected output of the following code? x = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]] def func(data): res = data[0][0] for da in data: for d in da: if res < d: res = d return res print(func(x[0]))A . The code is erroneous. B. 8 C....
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...
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)
What is the expected output of the following code?
What is the expected output of the following code? x = True y = False z = False if not x or y: print(1) elif not x or not y and z: print(2) elif not x or y or not y and x: print(3) else: print(4)A . 4 B. 3...
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...
What is the expected output of the following code?
What is the expected output of the following code? z = y = x = 1 print(x, y, z, sep='*')A . x*y*z B. 111* C. x y z D. 1*1*1 E. 1 1 1 F. The code is erroneous.View AnswerAnswer: D Explanation: Topic: multiple assignment print() with sep parameter Try...
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']...
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...
The value thirty point eleven times ten raised to the power of nine should be written as:
The value thirty point eleven times ten raised to the power of nine should be written as:A . 30.11E9 B. 30E11.9 C. 30.11E9.0 D. 30.11*10^9View AnswerAnswer: A Explanation: Topic: scientific notation Try it yourself: print(30.11E9) # 30110000000.0 # print(30E11.9) # SyntaxError: invalid syntax # print(30.11E9.0) # SyntaxError: invalid syntax #...
What is the expected output of the following code?
What is the expected output of the following code? def func(data): for d in data[::2]: yield d for x in func('abcdef'): print(x, end='')A . bdf B. An empty line. C. abcdef D. aceView AnswerAnswer: D Explanation: Topics: def yield for print() with end parameter list slicing Try it yourself: def...