repl.it
@Caoyq1992/

Turtle_2

Python (with Turtle)

No description

fork
loading
main.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
import turtle as turtle

# mr_turtle=turtle.Turtle()

# Ask the user to input the left turn angle
# If the user input the word "exit", exit the loop

# ifg=True

"""
while(ifg):
  left_Angle=input('Enter the turtle left turn angle or exit: ')
  mr_turtle.forward(30)
  mr_turtle.left(int(left_Angle))
  """

#   if left_Angle=='exit':
#     ifg=False
#     print('Out!')


# input_Varible=0
# keep_going=True

# while(keep_going):
#   input_variable=input('Enter your number: ')
#   if input_variable=='exit':
#     keep_going=False
#   else:
#     mr_turtle.forward(int(input_variable))
#     mr_turtle.left(int(input_variable))


# Draw two turtles

# tc=0
# while(tc<2):
#   input_variable=input('Enter your number: ')
#   for c in range(0,8,1):
#       mr_turtle.forward(int(input_variable))
#       mr_turtle.left(int(input_variable))
#   tc=tc+1


turtle_1=turtle.Turtle()
turtle_2=turtle.Turtle()
turtle_2.color('red')

keep_going=True
turtle_1_sizes=4
tries=0


while(keep_going):
  tries=tries+1
  turtle_1.forward(90)
  turtle_1.left(90)

  if tries>=turtle_1_sizes:
    keep_going=False


keep_going=True
tries=0
while(keep_going):
  tries=tries+1
  turtle_2.forward(90)
  turtle_2.left(120)

  if tries>=3:
    keep_going=False
result
console