欢迎您访问365答案网,请分享给你的朋友!
生活常识 学习资料

学习Python100d

时间:2023-05-28
题目列表

d1-15

01.初识Python

001.Helloworld.py002.Zen_Python.py003.Tryturtle.py d1-15 01.初识Python 001.Helloworld.py

【代码】

print('hello, world!')

【显示】

hello, world!

002.Zen_Python.py

【代码】

import this

【显示】

The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren’t special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you’re Dutch.
Now is better than never.
Although never is often better than right now.
If the implementation is hard to explain, it’s a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea – let’s do more of those!

003.Tryturtle.py

【代码】

import turtleturtle.pensize(4)turtle.pencolor('red')turtle.forward(100) #forward 100turtle.right(90) #turn rightturtle.forward(100)turtle.right(90)turtle.forward(100)turtle.right(90)turtle.forward(100)turtle.mainloop()

【显示】

Copyright © 2016-2020 www.365daan.com All Rights Reserved. 365答案网 版权所有 备案号:

部分内容来自互联网,版权归原作者所有,如有冒犯请联系我们,我们将在三个工作时内妥善处理。