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
32e04f20
authored
Feb 28, 2020
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
33a56590
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
118 deletions
hello.py
lianxi copy.py
lianxi.py
感谢悟空.py
查看原形.py
hello.py
View file @
32e04f20
# print("Hello world!")
print
(
"Hello world!"
)
# age = "12"
\ No newline at end of file
# 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 copy.py
0 → 100644
View file @
32e04f20
import
turtle
pen
=
turtle
.
Pen
()
pen
.
setpos
(
-
200
,
0
)
pen
.
shape
(
"turtle"
)
pen
.
color
(
"red"
)
pen
.
speed
(
1000
)
pen
.
fillcolor
(
"yellow"
)
pen
.
begin_fill
()
for
i
in
range
(
72
):
pen
.
forward
(
400
)
pen
.
right
(
175
)
for
i
in
range
(
360
):
pen
.
forward
(
1.7444
)
pen
.
right
(
1
)
pen
.
end_fill
()
pen
.
hideturtle
()
turtle
.
done
()
\ No newline at end of file
lianxi.py
View file @
32e04f20
...
@@ -6,9 +6,9 @@ pen.color("red")
...
@@ -6,9 +6,9 @@ pen.color("red")
pen
.
speed
(
500
)
pen
.
speed
(
500
)
pen
.
fillcolor
(
"pink"
)
pen
.
fillcolor
(
"pink"
)
pen
.
begin_fill
()
pen
.
begin_fill
()
for
i
in
range
(
72
):
for
i
in
range
(
5
):
pen
.
forward
(
200
)
pen
.
forward
(
200
)
pen
.
right
(
1
75
)
pen
.
right
(
1
44
)
pen
.
end_fill
()
pen
.
end_fill
()
pen
.
hideturtle
()
pen
.
hideturtle
()
...
...
感谢悟空.py
0 → 100644
View file @
32e04f20
name
=
"悟空 "
name
=
"悟空 "
word
=
"非常感谢!"
print
(
name
+
word
)
\ No newline at end of file
查看原形.py
0 → 100644
View file @
32e04f20
num
=
9
num
=
9
float_num
=
3.1415926
name
=
"悟空"
goods
=
[
"雪碧"
,
"可口可乐"
,
"咖啡"
]
print
(
type
(
num
))
print
(
type
(
float_num
))
print
(
type
(
name
))
print
(
type
(
goods
))
\ 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