1 Star 0 Fork 0

上善若水/LearningPython3

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ex38.py 643 Bytes
一键复制 编辑 原始数据 按行查看 历史
上善若水 提交于 2023-09-07 14:53 . # 练习代码提交(旧)
ten_things = "Apples Oranges Crows Telephone Light Sugar"
print("Wait there are 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(f"There are {len(stuff)} items now.")
print("There wo 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!
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/my-Jurassica-Park/LearningPython3.git
git@gitee.com:my-Jurassica-Park/LearningPython3.git
my-Jurassica-Park
LearningPython3
LearningPython3
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385