鱼C论坛

 找回密码
 立即注册
查看: 1611|回复: 1

[已解决]想知道这个语法哪里有问题

[复制链接]
发表于 2023-6-13 22:57:06 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
ten_things="Apples Oranges Crows Telephone Light Sugar"

print("Wait there's not 10 things in that list,let's fix that.")

stuff=ten_things.split()
more_stuff=["Day","Night","Song","Frisbee","Corn","Banana","Girl","Boy"]
while len(stuff)!=10:
    next_one=more_stuff.pop()
    print("Adding:",next_one)
    stuff.append(next_one)
    print("There is %d items now."%len(stuff)
print("There we go:",stuff)
print("Let's do some things with stuff.")
print(stuff[1])
print(stuff[-1])#whoa!fancy
print("stuff.pop()")
print''.join(stuff)#what?cool!
print'#'.join(stuff[3:5])#super stellar!
截图未命名.jpg
最佳答案
2023-6-13 22:59:53
Snipaste_2023-06-13_22-59-34.png
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2023-6-13 22:59:53 | 显示全部楼层    本楼为最佳答案   
Snipaste_2023-06-13_22-59-34.png
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

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

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-9-22 19:31

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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