-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
129 lines (100 loc) · 2.41 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# import turtle
# t = turtle.Turtle()
# t.shape("turtle")
# color_list = ["yellow", "red", "blue" , "green"]
# t.fillcolor(color_list[0])
# t.begin_fill()
# t.circle(100)
# t.end_fill()
# t.forward(50)
# t.fillcolor(color_list[1])
# t.begin_fill()
# t.circle(100)
# t.end_fill()
# import turtle
# t =turtle.Turtle()
# t.shape("turtle")
# t.penup()
# t.goto(100, 100)
# t.write("거북이가 여기로오면 0")
# t.goto(100, - 100)
# t.write("거북이가 여기로오면 음수입니다")
# t.goto(0, 0 )
# t.pendown()
# s= turtle.textinput ("","숫자를 입력하시오")
# n =int(s)
# if( n >0):
# t.goto(100, 100)
# if (n == 0):
# t.goto(100, 0)
# if(n < 0):
# t.goto(100, -100)
# import turtle
# t =turtle.Turtle()
# t.width(3)
# t.shape("turtle")
# t.shapesize(3,3)
# while True:
# command = input ("명령을 입력하시오")
# if command == "i":
# t.left(90)
# t.forward(100)
# if command == "r":
# t.right(90)
# t.forward(100)
# import random
# print("동전던지기")
# coin = random.randrange(2)
# if coin == 0:
# print("앞면")
# else:
# print("뒷면")
# print("게임종료")
# import turtle
# import random
# screen = turtle.Screen()
# image1 = "front.gif"
# image2 = "back.gif"
# screen.addshape(image1)
# screen.addshape(image2)
# t1 = turtle.Turtle()
# coin = random.randint(0, 1)
# if coin == 0 :
# t1.shape(image1)
# t2.stamp()
# else:
# t1.shape(image2)
# t1.stamp()
# import random
# time = random.randint(1, 24)
# print("좋은아침입니다 .지금시각은 ." + str(time)+ "시입니다")
# sunny = random.choice([True, False])
# if sunny:
# print("현재 날씨가 화창합니다")
# else:
# print("현재 날씨가 화창하징않습니다")
# if(time >= 6) and (time < 9) and sunny:
# print("종달새가 노래를한다.")
# else:
# print("종달새가 노래를 하지않는다")
# id =" i love python"
# s = input("아이디를 입력하시오")
# if s == id:
# print("환영합니다")
# else:
# print("아이디를 찾을수없습니다")
import turtle
t = turtle.Turtle()
t.shape("turtle")
s =turtle.textinput("", "도형을입력하시오")
if s =="사각형":
s = turtle.textinput("","가로:")
w = int(s)
s = turtle.textinput("","세로")
h = int(s)
t.forward(w)
t.left(90)
t.forward(h)
t.left(90)
t.forward(w)
t.left(90) t.forward(h)