import turtle
class Shapes:
def __init__(self, length, sides=4, color="red"):
self.length = length
self.sides = sides
self.color = color
self.inside_angle_sum = (self.sides - 2) * 180
self.individual_angle = self.inside_angle_sum / self.sides
def drawing(self):
turtle.color = self.color #do not get why this wont run
for i in range(self.sides):
turtle.forward(self.length)
turtle.left(180 - self.individual_angle)
square = Shapes(100, 4)
square.drawing()
答案 0 :(得分:0)
turtle.color需要():
df1 <- structure(list(Date = c("2020-01-01", "2020-01-02", "2020-01-03",
"2020-01-04", "2020-01-05", "2020-01-06", "2020-01-07", "2020-01-08",
"2020-01-09", "2020-01-10"), Price = c(500L, 550L, 480L, 420L,
450L, 390L, 430L, 480L, 490L, 485L)), class = "data.frame", row.names = c(NA,
-10L))
df2 <- structure(list(Date = c("2020-01-01", "2020-01-04", "2020-01-06",
"2020-01-07", "2020-01-10"), Price2 = c(50L, 20L, 90L, 30L, 80L
)), class = "data.frame", row.names = c(NA, -5L))