关系比较运算符
"""
关系比较运算符
"""
def test_func():
# !=
print(1 != 2) # true
print(1 != 1) # false
print('*' * 10) #IndentationError: unindent does not match any outer indentation level
# == 注意两个等号之间没有间隔
print(1 == 2) # false
print(1 == 1) # true
test_func()
这样写着会报错 print(‘*’ * 10),提示缩进错误
"""
关系比较运算符
"""
def test_func():
# !=
print(1 != 2) # true
print(1 != 1) # false
print('*' * 10)
# == 注意两个等号之间没有间隔
print(1 == 2) # false
print(1 == 1) # true
test_func()
这样就没毛病了 ,结果如下
"""
关系比较运算符
"""
def test_func():
# !=
print(1 != 2) # true
print(1 != 1) # false
print('*' * 10)
# == 注意两个等号之间没有间隔
print(1 == 2) # false
print(1 == 1) # true
print('*' * 10)
# >=
# <=
print(1 >= 2) # false
print(1 <= 2) # true
test_func()
评论 (0)