Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson10-3
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
48cf3791
authored
Jul 16, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
8d9089ae
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
2 deletions
1.py
123.py
4.py
diy1.py
1.py
0 → 100644
View file @
48cf3791
import
random
a
=
"今晚动手"
b
=
"爱国时间啊肯定会撒扩大撒娇客户四大皆空黑客技术是覅就"
index
=
random
.
randint
(
0
,
len
(
a
))
c
=
list
(
a
)
c
.
insert
(
index
,
"#$
%
^&"
)
a
=
""
.
join
(
c
)
for
i
in
a
:
str1
=
i
str2
=
random
.
choice
(
b
)
str3
=
random
.
choice
(
b
)
text
=
str1
+
str2
+
str3
print
(
text
,
end
=
""
)
\ No newline at end of file
123.py
0 → 100644
View file @
48cf3791
a
=
0
#变量
b
()
#函数
"abc"
#字符串
def
#关键字
==#等于
=#赋值
#7月6日
getx
()
#x的坐标
gety
()
#y的坐标
if
iskeydown
(
"a"
):
#判断是否按下a键
if
istouching
(
"bug"
):
#判断是否碰到bug
if
distanceto
(
"bug"
)
==
0
:
#判断是否和bug的距离等于0
if
...
else
...
#如果...那么...否则...
#7月7日
if
ismousedown
():
#是否按下鼠标
while
...
#满足...条件循环
faceto
()
#面向
moveto
()
#移到
#7月8日
#三大运算符
#数学运算符
+
-
*
/
%
#比较运算符
>
<
==
>=
<=
#逻辑运算符
and
or
not
#项目名/程序名
\ No newline at end of file
4.py
0 → 100644
View file @
48cf3791
try
:
age
=
int
(
input
(
'你今年几岁了'
))
except
:
print
(
'要输入整数啊'
)
else
:
if
age
<
18
:
print
(
'不可以喝酒嗷'
)
print
(
'程序结束~'
)
\ No newline at end of file
diy1.py
View file @
48cf3791
...
...
@@ -5,9 +5,9 @@ scores = {'语文':89, '数学':95, '英语':80}
def
get_average
(
scores
):
score
=
0
for
i
in
scores
.
key
():
for
i
in
scores
.
key
s
():
score
+=
scores
[
i
]
print
(
'现在的总分是'
+
str
(
score
))
ave_score
=
score
/
len
(
scores
)
ave_score
=
int
(
score
/
len
(
scores
)
)
print
(
'平均分是'
+
str
(
ave_score
))
get_average
(
scores
)
\ 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