Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson1_1
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
2fa810e8
authored
Aug 06, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
1328ee1a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
103 deletions
day1.py
day2.py
pen.py
python.py
day1.py
View file @
2fa810e8
##############自学python#############
"""
# 首字母大写 title()
# 字符串全部大写 upper()
# 字符串全部小写 lower()
name = "Adc Loveface"
print(name.title())
print(name.upper())
print(name.lower())
# 合并(拼接)字符串 +
CHN_name = "zheng cheng zhi"
ENG_name = "kimi"
full_name = CHN_name + " " + ENG_name
print("Hello," + full_name.title() + "!")
# 在字符串中添加制表符
\t
# 在字符串中添加换行符
\n
print("
\t
python")
print("python")
print("Languages:
\n
Pytho
\n
C
\n
JaveScript")
print("Languages:
\n\t
Python
\n\t
C
\n\t
JaveScript")
"""
bicy
=
[
'rrt2'
,
'yyyy'
,
'rrr4'
,
'ioio5'
,
'iuh0'
]
print
(
bicy
[
-
5
])
day2.py
View file @
2fa810e8
# 确定宴会邀请名单
party
=
[
'xiao ming'
,
'xiao long'
,
'xiao li'
]
print
(
party
)
# 删除无法赴宴人员名单,并说明原因
party1
=
'xiao li'
party
.
remove
(
party1
)
print
(
party1
.
title
()
+
"有事来不了了。"
)
# 添加新邀请人员名单,并打印
party
.
append
(
'xiao hong'
)
print
(
party
)
# 向确定名单的每个人发出邀请
print
(
party
[
0
]
.
title
()
+
"您好,邀请您来参加本末的晚宴!"
)
print
(
party
[
1
]
.
title
()
+
"您好,邀请您来参加本末的晚宴!"
)
print
(
party
[
2
]
.
title
()
+
"您好,邀请您来参加本末的晚宴!"
)
print
(
"我找到了一个更大的包间"
)
# 新增三位宴会嘉宾名单
party
.
insert
(
0
,
'xiao qing'
)
party
.
insert
(
2
,
'xiao xue'
)
party
.
append
(
'xiao peng'
)
print
(
party
)
# 向新的宴会名单发出通知
print
(
party
[
0
]
.
title
()
+
"lai chi fan la"
)
print
(
party
[
1
]
.
title
()
+
"lai chi fan la"
)
print
(
party
[
2
]
.
title
()
+
"lai chi fan la"
)
print
(
party
[
3
]
.
title
()
+
"lai chi fan la"
)
print
(
party
[
4
]
.
title
()
+
"lai chi fan la"
)
print
(
party
[
5
]
.
title
()
+
"lai chi fan la"
)
# 包间又没有了,宴请不了这么多人,只能请两人
poped_party1
=
party
.
pop
()
print
(
poped_party1
.
title
()
+
"实在不好意思,这个周末不能请你参加宴会了"
)
print
(
party
)
\ No newline at end of file
pen.py
View file @
2fa810e8
import
turtle
pen
=
turtle
.
Pen
()
pen
.
setpos
(
-
200
,
0
)
#画笔速度
pen
.
speed
(
50
)
#画笔颜色
pen
.
color
(
"red"
)
#填充颜色
pen
.
fillcolor
(
"yellow"
)
#开始填充颜色
pen
.
begin_fill
()
for
i
in
range
(
72
):
pen
.
forward
(
400
)
pen
.
right
(
175
)
pen
.
end_fill
()
turtle
.
done
()
python.py
View file @
2fa810e8
import
turtle
p
=
turtle
.
Pen
()
p
.
setpos
(
-
200
,
0
)
p
.
speed
(
50
)
p
.
color
(
"red"
)
p
.
fillcolor
(
"yellow"
)
p
.
begin_fill
()
for
i
in
range
(
72
):
p
.
forward
(
400
)
p
.
right
(
175
)
p
.
end_fill
()
p
.
hideturtle
()
turtle
.
done
()
\ 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