Python 海象运算符_小嗷犬的博客-CSDN博客
myStr = "abcdefghijgk"
'''
# n = len(myStr) throw out exception when compling
if n = len(myStr) > 10 : print(f"{myStr} length: {n} is too long, expect less 10")
else:print(f"{myStr} length: {n} is not too long, expect less 10")
'''if (m := len(myStr)) > 10 :print(f"{myStr} length: {m} is too long, expect less 10")
else: print(f"{myStr} length: {m} is too long, expect less 10")