KnowledgeBoat Logo
|
LoginJOIN NOW

Informatics Practices

What will be the output of the following Python code?

>>> 6*3+4**2//5-8
  1. 13
  2. 14
  3. Error
  4. None

Python Funda

3 Likes

Answer

13

Reason — The expression 6*3+4**2//5-8 follows Python's operator precedence rules, where exponentiation (4**2) is evaluated first resulting in 16. Then, floor division (16//5) is calculated as 3. Next, multiplication (6*3) gives 18. Adding these results (18 + 3) yields 21. Finally, subtracting 8 from 21 results in 13.

Answered By

1 Like


Related Questions