小编Rob*_*ood的帖子

使用我的If,Else和Elif语句(Python)的"语法错误"

这是我的代码:

print "Hello, and welcome to the Slightly Interactive Autobiography of Robbie Wood."
print "Lets get started, shall we? What chapter would you like to read first?"
chapter = raw_input("Please type either 'Chapter 1', 'Chapter 2' or 'Chapter 3': ")

if chapter = "Chapter 1":
    print "Chapter 1"
    print chapter_one

else chapter = "Chapter 2":
    print "Chapter 2"
    print chapter_two

elif chapter = "Chapter 3":
    print "Chapter 3"
    print chapter_three

elif:
    chapters = raw_input("Please type either 'Chapter 1', 'Chapter 2', …
Run Code Online (Sandbox Code Playgroud)

python syntax if-statement

2
推荐指数
1
解决办法
5482
查看次数

标签 统计

if-statement ×1

python ×1

syntax ×1