Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solución reto#27 Python #1368

Open
grisales54 opened this issue Oct 5, 2024 · 0 comments
Open

Solución reto#27 Python #1368

grisales54 opened this issue Oct 5, 2024 · 0 comments

Comments

@grisales54
Copy link

`def dibujo(size=1, figura="cuadrado"):
"""Función que imprime figuras, dependiendo de su entrada"""

if figura == "cuadrado":

    for i in range(size):
        #Esta línea imprime el cuadrado
        print("*" * size)

elif figura == "triangulo":

    for i in range(1, size):
        #Esta línea imprime cada fila del triángulo
        print(" " * (size - i) + "*" * (2 * i - 1))

dibujo(10, "triangulo")
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant