Quick actions

cmd+k|ctrl+k

Navigation

Languages

ZTM-TCPD-04

Snippet info

Language

Python

Visibility

public

Author

lawkoh

Created

2025-03-25T14:21:01.068736Z

Updated

2025-03-25T14:30:08.142107Z

# #operator precedence
# print(20 - 3 * 4)

# print((20 - 3) + 2 ** 2)

# ()
# **
# * / //
# + -

# Exercise from trainer

# Guess the output of each answer before you click RUN
# Try to write down your answer before and see how you do... keep it mind I made it a little tricky for you :)

print((5 + 4) * 10 / 2) # 45.0

print(((5 + 4) * 10) / 2) # 45.0

print((5 + 4) * (10 / 2)) # 45.0

print(5 + (4 * 10) / 2) # 25.0

print(5 + 4 * 10 // 2) # 22 wrong - answer is 25
INFO