Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
tuna = "fish" if tuna == "fish": print ' this is fish'
执行代码时出现无效语法错误。请更正我的代码。
在 python 3 中,printis a functionprint('hello world')而不是 python 2.x 中的语句print 'hello world',基本上你忘记了括号:
print
print('hello world')
print 'hello world'
tuna = "fish" if tuna == "fish": print('this is fish')
输出将是:
这是鱼