猫史档案馆


自学Python的小白求帮忙

用户:杉某人杉某人查看:0 回复:1 评论:0 创建时间:2021-10-13T19:47:50


def pet_dog(name,type='dog'):
       """显示宠物信息"""
       print(f"\nI have a {type} "):
       print(f"Its name is {name}")

pet_dog('Peter')

我用的是sublime txet,不知道为什么他说我错误


回复

上一页1 页 / 共 1下一页
伴雪纷飞伴雪纷飞

def pet_dog(name,type='dog'):
       """显示宠物信息"""
       print(f"\nI have a {type} ")
       print(f"Its name is {name}")

pet_dog('Peter')

第三行多加了个':'

跟解析器没有关系

点赞0


评论