Generation

generate functionTue, 15 Nov 2022

an interactive session that draws an ascii art polygon based on user input

def polygon(n): for i in range(n): print ' ' * (n - i - 1) + '*' * (2 * i + 1) return polygon(3)

Questions about programming?Chat with your personal AI assistant