Commit a48e406f by BellCodeEditor

auto save

parent 559fef77
Showing with 8 additions and 2 deletions
message = "诺依,周末一起去看动漫展吧!"
# 请使用索引的知识,取出message所有元素(不用遍历的方式)
\ No newline at end of file
# 请使用索引的知识,取出message所有元素(不用遍历的方式)
length = len(message) # len()方法名参数为列表名并赋值给变量length
i = 1 # 建立变量i初始值设为1
while i < length: # whlie循环 直到i<length
element = message[i] # 列表名[i]并赋值给变量element
print(element) # 打印出变量element
i += 1 # 每次循环变量i增加1
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment