Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson2-2_DIY1
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
93429768
authored
Dec 11, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
25abb509
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
3 deletions
diy1.py
diy1.py
View file @
93429768
player
=
input
(
"请出拳:石头/剪刀/布"
)
# 玩家出拳
print
(
"玩家出拳:"
+
player
)
\ No newline at end of file
# print(12) #输出、打印
# print("你好") #打印字符串
# print("&(VY@") #打印特殊符号
# print(10+9-22) #数学运算
# print(12, "你好", "*(&)", 3+98)
# 海龟画图
import
turtle
#1、导入海龟画图
p1
=
turtle
.
Pen
()
#2、创建一支画笔
p1
.
shape
(
"turtle"
)
#设置画笔形状
# 'arrow'箭头, 'turtle'海龟, 'circle'圆,
# 'square'方形, 'triangle'三角形, 'classic'默认.
p1
.
color
(
"red"
)
#设置画笔颜色
p1
.
pencolor
(
"blue"
)
for
i
in
range
(
5
):
#重复执行
p1
.
forward
(
100
)
#前进
p1
.
left
(
72
)
#转弯
turtle
.
done
()
#3、画布保持不关闭
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment