COMPUTER PROGRAMMING FUNDAMENTALS
PROGRAMMING LANGUAGES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
What will the output be from the following code?print(9/3)
|
3
|
|
3.0
|
|
9/3
|
|
SyntaxError
|
Explanation:
Detailed explanation-1: -The basic way to do output is the print statement. To end the printed line with a newline, add a print statement without any objects. This will print to any object that implements write(), which includes file objects.
Detailed explanation-2: -Explanation: The code shown above returns a new list containing only those elements of the list l which do not amount to zero. Hence the output is: [1, 2, ‘hello’].
Detailed explanation-3: -In Python 2 the quotient returned for the expression 11 / 2 is 5 .
There is 1 question to complete.