【发布时间】:2022-12-03 18:58:19
【问题描述】:
def cake(people):
chocolate = 20
flour = 20
butter = 20
people = int(input("give a number")
if(people > 0):
print(chocolate == chocolate*people)
print(flour == flour*people)
print(butter == butter*people)
else:
print("nothing")
return(chocolate, flour, butter)
大家好, 我最近开始学习 python 语言,我试图将这个函数作为练习,但是我在 if 语句的括号后的冒号空间有一个无效的语法。
我该怎么做才能解决这个问题?
预先感谢您的回答
【问题讨论】:
标签: python-3.x