2024-06-16 11:07:16 发布
网友
我想在python3中运行这段代码,但我做不到。每当我试图运行代码时,就会出现无效语法错误。你知道吗
age = 20 name = 'Swaroop' print '{} was {} years old when he wrote this book'.format(name, age) print 'Why is {} playing with that python?'.format(name)
请帮帮我。你知道吗
谢谢你。你知道吗
在print函数调用周围加上括号。你知道吗
print
print('{} was {} years old when he wrote this book'.format(name, age)) print('Why is {} playing with that python?'.format(name))
在Python2中,print是一个语句,不需要括号。你知道吗
In Python3, ^{} is a function,所以它需要在参数周围加括号。你知道吗
在
print
函数调用周围加上括号。你知道吗在Python2中,
print
是一个语句,不需要括号。你知道吗In Python3, ^{} is a function ,所以它需要在参数周围加括号。你知道吗
相关问题 更多 >
编程相关推荐