+ 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)

20th Jun 2017, 9:34 AM
Karthick Raj
Karthick Raj - avatar
1 Odpowiedź
+ 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
18th Jun 2019, 1:46 AM
Da2
Da2 - avatar