+ 2
This how to create a polymorphism using function and loop
import turtle #here i am just declare my_box as turtle my_box=turtle.Turtle #here i am just define function def polygon(length,angle): my_box.forward(length) my_box.left(angle) #this part is actually how many time do draw a #line for draw in range(8): polygon(100, 45)
1 Answer
+ 1
Read on Object Oriented Programming concepts. Polymorphism is quite tricky. You may also try to understand Recursion, which is necessary to implement polymorphic algorithms