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
afd20158
authored
Feb 27, 2020
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
8205f0ee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
133 additions
and
0 deletions
hello.py
lianxi.py
hello.py
0 → 100644
View file @
afd20158
# print("Hello world!")
# age = "12"
# print("小明今年"+age+"岁了")
"""
x = 50
y = 14
print("x//y =",x//y)
x = [1,2,3,4]
x.append(4)
print(x)
str1 = "Nice Again!"
print("str1 =",str1[2:-3])
list1 = ['Tom','Jack','Chris','Evan']
list1.pop(1)
print(list1)
print('hahaha',"hahaha",'''hahaha''')
unkonwn = ()
print(type(unkonwn))
list1 = ['a','b','c','d','e']
# list1.pop(1) # ok
# list1.pop('b')# no
# del list1[2] # no
# list1.remove('b') # ok
# list1.pop(2) # no
# del list1[1] # ok
print(list1)
dict1 = {'Name':'Tom','Age':35}
print(dict1['Age'])
str1 = "Excuse me"
print(str1[3:6]) # no
print(str1[2:6]) # ok
print(str1[-8:-3]) # no
print(str1[-7:-3]) # ok
print(str1[2:-3]) # ok
# 填空题1 答案:[1,2]
list1 = [1,2,3,4,5]
list2 = []
for i in list1:
if i == 3:
break
list2.append(i)
print(list2)
# 填空题2 答案:[0,7,14,21,28]
list1 = []
for i in range(0,30,7):
list1.append(i)
print(list1)
# 填空题3 答案:4950
x = 1
sum = 0
while x < 100:
sum += x
x += 1
print(sum)
# 填空题4 答案:7.6
x = 5
y = 12
print(x-y/x+x)
# 填空题5 答案:89
x = 5
y = 6
print(x**3-y**2)
# 填空题6 答案:dgv
str1 = 'sdfg'
str2 = 'cvbn'
print(str1[1::2] + str2[1:2])
# 填空题7 答案:[3,4,5]
# def test_func(list):
# print(list[-5:-2])
#
# list1 = [1,2,3,4,5,6,7]
# test_func(list1)
# 填空题8 答案:[2,3,5]
x = [3,2,5]
if x[0] > x[1]:
x[0], x[1] = x[1],x[0]
if x[1] > x[2]:
x[1], x[2] = x[2],x[1]
print(x)
x = (1,2,3,4,2)
del x(2)
print(x)
"""
lianxi.py
0 → 100644
View file @
afd20158
import
turtle
pen
=
turtle
.
Pen
()
pen
.
shape
(
"turtle"
)
pen
.
color
(
"red"
)
pen
.
speed
(
500
)
pen
.
fillcolor
(
"pink"
)
pen
.
begin_fill
()
for
i
in
range
(
72
):
pen
.
forward
(
200
)
pen
.
right
(
175
)
pen
.
end_fill
()
pen
.
hideturtle
()
turtle
.
done
()
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