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("3*4+5")
|
SyntaxErrror
|
|
17
|
|
3*4+5
|
|
12
|
Explanation:
Detailed explanation-1: -The output of this code is (3* ‘7’) is 777, 7 is put into quotation marks which means it will output 7-3 other times.
Detailed explanation-2: -What is the output of print (2**3**5) ** represents the exponent. By law of exponents, (x^a)^b=x^(a×b) So here, the answer will be, 2^15=32768 In case of python, it calculates the 2nd part first, which gives, 2^(243). Use of brackets plays a key role.
Detailed explanation-3: -So, int("3” + “4") = int("34") = 34. x=int("3")+int("4") print(x) then output is 7.
Detailed explanation-4: -Answer: So the output is type ‘type’.
There is 1 question to complete.