Question #772

What is the output of the code snippet below?
print(8/4/2, 8/(4/2))

8/4/2, 8/(4/2) is evaluated as: 2/2, 8/2 which gives 1.0, 4.0 . If no brackets are present, the first operator (in this case / ) will take precedence over the next ones. (programiz.com/python-programming/precedence-associativity)


Comment on Disqus:

Question difficulty: 🔵🔵🔵🔵🔵