# - is left associative 9 - 3 - 1 # a parenthesis is needed if the right - is required to be executed first 9 - (3 - 1) # * has higher precedence than + or 1. 4 + 2 * 5 - 6 # //, / and * are left associative. 6 // 4 / 2 # //, / and * are left associative. 4 * 8 // 5 # () is needed with the right // should be executed first. It returns a different result. 4 * (8 // 5) # ** is right associative 2 ** 3 ** 2 # () is needed if the left ** should be executed first. (2 ** 3) ** 2 # bitwise left shift is left associative. 6 >> 3 >> 1 # a pair of parentheis is need if the right >> should be executed first. 6 >> (3 >> 1) # comparison operators have a higher precedence than relational operators. and has a higher precedence than or. 1 < 2 or 3 < 4 and 4 > 6 (1 < 2 or 3 < 4) and 4 > 6 1 < 2 or (3 < 4 and 4 > 6)