方法一:while循环

s = "懵逼树上懵逼果"
index = 0
while index < len(s): #索引长度
    print(s[index]) #用索引取元素
    index += 1 #自增

方法二:for循环

s = "懵逼树上懵逼果"
for i in s:
  print(i)
Categories: python

0 Comments

发表评论

Avatar placeholder

邮箱地址不会被公开。 必填项已用*标注