小白教程

 找回密码
 立即注册
查看: 5911|回复: 0

得到一个语法错误,我不知道为什么

[复制链接]

2

主题

5

帖子

12

积分

新手上路

Rank: 1

积分
12
发表于 2021-5-20 03:44:36 | 显示全部楼层 |阅读模式
我已经看了整个代码,看不出出了什么问题。请帮我
  1. food = ['donuts', 'pancakes', 'bacon', 'waffles', 'eggs', 'bagels']
  2. score = [0,0,0,0,0,0]

  3. print('Please answer each question with "y" for "yes" and "n" for "no".')
  4. user_input = input('Do you like food with holes? ')
  5. user_input2= input('do you like stuff made from animals? ')
  6. user_input3=input('do you like sweets')
  7. user_input4=input(' ')
  8. if user_input == 'y':
  9.   score[0] = score[0] + 1
  10.   score[5] = score[5] + 1
  11. elif user_input =='n':
  12.   score[0] = score[0]-1
  13.   score[1] = score[1]-1
  14. if user_input2 == 'y':
  15. score[0] = score[0] + 1
  16. score[5] = score[1] + 1
  17. elif user_input2 == 'n':
  18.   score[0] = score[0]-1
  19.   score[1] = score[1]-1
  20. if user_input3 == 'y':
  21. score[0] = score[0] + 1
  22. score[5] = score[5] + 1
  23. elif user_input3 == 'n':
  24.   score[0] = score[0]-1
  25.   score[1] = score[1]-1]
复制代码


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|小白教程 ( 粤ICP备20019910号 )

GMT+8, 2024-9-20 15:01 , Processed in 0.394972 second(s), 23 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc. Template By 【未来科技】【 www.wekei.cn 】

快速回复 返回顶部 返回列表