WRITE IN PYTHON Assume the density of the star is 2. The prompt asks for 2 functions for each shape. One using iteration
Posted: Tue Jul 12, 2022 8:04 am
WRITE IN PYTHON
Assume the density of the star is 2.
The prompt asks for 2 functions for each shape. Oneusing iteration one using recursion. Please help, thankyou!
TASK: Write a program named shapes.py that has two functions for generating convex and star regular polygons. Each function should be implemented by using iteration (a for loop) and recursion. It is optional to fill in your shapes. The function for generating polygons can be named polygon(size, n) and the function that generates stars can be named star(size, n), where size is the size of the polygon side (edge) and n is the number of sides (or angles).
Assume the density of the star is 2.
The prompt asks for 2 functions for each shape. Oneusing iteration one using recursion. Please help, thankyou!
TASK: Write a program named shapes.py that has two functions for generating convex and star regular polygons. Each function should be implemented by using iteration (a for loop) and recursion. It is optional to fill in your shapes. The function for generating polygons can be named polygon(size, n) and the function that generates stars can be named star(size, n), where size is the size of the polygon side (edge) and n is the number of sides (or angles).