大白兔奶糖12138 发表于 2021-8-2 10:42:39

为什么报错

def watchMovie(name="小甲鱼",cigaertte=True,beer=True,girlfirend=True):
        sentence = name+"带着"
        if cigarette:
                sentence = sentence+"香烟"
        if beer:
                sentence = sentence+"啤酒"
        if girlfriend:
                if cigarette or beer:
                        sentence=sentence+"和女朋友"
                else:
                        sentence = sentence+"女朋友"
        sentence = sentence+"去看电影"
        reture sentence
       
SyntaxError: invalid syntax

qq1151985918 发表于 2021-8-2 10:44:47

拼写错误 reture
应该是 return
页: [1]
查看完整版本: 为什么报错