Generation

generate functionMon, 10 Jul 2023

realizar un programa utilizando el bucle for que pida la anchura de un triangulo y que lo dibuje con caracteres producto (*)

def draw_triangle(width): for i in range(0, width): if i == 0: print("*") elif i == width-1: print("*" * width) else: print("*" + " " * (width -2) + "*") draw_triangle(5)

Want to kickstart your project?Use the new AI Studio to create your code