Skip to content

Commit c1fd0a1

Browse files
committed
python
0 parents  commit c1fd0a1

File tree

10 files changed

+162
-0
lines changed

10 files changed

+162
-0
lines changed

Diff for: .idea/.gitignore

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: .idea/inspectionProfiles/profiles_settings.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: .idea/misc.xml

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: .idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: .idea/python-demo1.iml

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: draw_olympic.py

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import turtle
2+
3+
#第一个圆
4+
turtle.width(10)
5+
turtle.color('blue')
6+
turtle.circle(50)
7+
8+
#第二个圆
9+
turtle.penup()
10+
turtle.goto(80,0)
11+
turtle.pendown()
12+
turtle.color('black')
13+
turtle.circle(50)
14+
15+
#第三个圆
16+
turtle.penup()
17+
turtle.goto(160,0)
18+
turtle.pendown()
19+
turtle.color('red')
20+
turtle.circle(50)
21+
22+
#第四个圆
23+
turtle.penup()
24+
turtle.goto(40,-60)
25+
turtle.pendown()
26+
turtle.color('yellow')
27+
turtle.circle(50)
28+
29+
#第五个圆
30+
turtle.penup()
31+
turtle.goto(110,-60)
32+
turtle.pendown()
33+
turtle.color('green')
34+
turtle.circle(50)
35+
36+
37+
turtle.done()

Diff for: myExercise.py

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import turtle
2+
3+
#第一个圆
4+
turtle.width(10)
5+
turtle.color('blue')
6+
turtle.circle(60)
7+
8+
9+
#第二个圆
10+
turtle.penup()
11+
turtle.goto(140,0)
12+
turtle.pendown()
13+
turtle.color('black')
14+
turtle.circle(60)
15+
16+
17+
#第三个圆
18+
turtle.penup()
19+
turtle.goto(280,0)
20+
turtle.pendown()
21+
turtle.color('red')
22+
turtle.circle(60)
23+
24+
#第四个圆
25+
turtle.penup()
26+
turtle.goto(70,-70)
27+
turtle.pendown()
28+
turtle.color('yellow')
29+
turtle.circle(60)
30+
31+
#第五个圆
32+
turtle.penup()
33+
turtle.goto(210,-70)
34+
turtle.pendown()
35+
turtle.color('green')
36+
turtle.circle(60)
37+
38+
turtle.done(); #表示 窗口一直存在

Diff for: mypr01.py

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# 我的第一个 python程序
2+
print('hello world!')
3+
print("hym")
4+
if 1<2:
5+
print('true')
6+
7+
"""
8+
我是多行注释
9+
"""

Diff for: mypr02.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import turtle
2+
3+
turtle.showturtle() #显示箭头
4+
turtle.write('hym,你好!') #在窗口中写字
5+
turtle.forward(300) #前进300像素
6+
turtle.color('violet') #改变画笔的颜色
7+
turtle.left(90) #箭头左转90度
8+
turtle.forward(300) #前进300像素
9+
turtle.goto(0,0) #回到原点
10+
turtle.penup() # 抬笔 不用画路径
11+
turtle.goto(0,50) #移动到坐标(0,50)
12+
turtle.pendown() # 下笔
13+
turtle.circle(100) #半径为100的圆
14+
15+
turtle.done(); #表示 窗口一直存在

Diff for: mypr03.py

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
3+
a = 3
4+
print(id(a))
5+
print(type(a))
6+
print(a)
7+
8+
b=[1,2,3]
9+
print(id(b))
10+
print(type(b))
11+
print(b)
12+
13+
c = 'i love python'
14+
print(id(c))
15+
print(type(c))
16+
print(c)
17+
18+
d = {'name':'hym','age':18}
19+
print(id(d))
20+
print(type(d))
21+
print(d)
22+
23+
# e = (1,2,3)
24+
# print(id(e))
25+
# print(type(e))
26+
# print(e)
27+
z1=3+4j
28+
z2=1-2j
29+
print(z1 * z2)

0 commit comments

Comments
 (0)