Operator, truth values
x = [1, 2]y = [1, 2]print(x == y) # equality operatorprint(x is y) # identity operator# Output:TrueFalsea = 2b = 2print(a == b) # equality operatorprint(a is b) # identity operator# Output:TrueTrueo = 'b' > 'a'print(o)# Output:Trueo = [1, 2] > [2, 1]print(f"1. {o}")o = [4, 1] > [3, 1]print(f"2. {o}")o = [1, [2, 3]] > [1, [2, 4]]print(f"3. {o}")o = [1, [2, 10]] > [1, [2, 9]]print(f"4. {o}")# Outp..
Python
2024. 12. 25. 08:27