Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson2-3-1_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
cb3c51e1
authored
Sep 24, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
a47e0cbb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
4 deletions
123.py
Untitled-1.py.py
diy1.py
123.py
0 → 100644
View file @
cb3c51e1
player
=
input
(
"请出拳(石头/剪刀/布):"
)
print
(
"玩家出拳:"
+
player
)
import
random
list
=
[
"石头"
,
"剪刀"
,
"布"
]
computer
=
random
.
choice
(
list
)
print
(
computer
)
\ No newline at end of file
Untitled-1.py.py
0 → 100644
View file @
cb3c51e1
import
turtle
#import导入库,后面接模块名,调用turtle模块里面的类和方法
pen
=
turtle
.
Pen
()
#实例化一只笔,调用turtle模块中的笔
pen
.
shape
(
"turtle"
)
# "."表示这个文件/文件夹下的某个内容,设置笔外形(“arrow”,“turtle”,“circle”,“square”,“triangle”,“classic”)六种外形
pen
.
color
(
"red"
)
#设置填充颜色
pen
.
begin_fill
()
#设置填充起点
for
i
in
range
(
300
):
pen
.
forward
(
100
)
pen
.
right
(
97
)
#for循环,画出一个三角形
pen
.
end_fill
()
#设置填充终点
pen
.
hideturtle
()
#隐藏画笔
turtle
.
done
()
#保存画布
\ No newline at end of file
diy1.py
deleted
100644 → 0
View file @
a47e0cbb
# 玩家出拳
player
=
input
(
"请出拳(石头/剪刀/布):"
)
print
(
"玩家出拳:"
player
)
\ 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