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#28 Python #1369

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

Solución reto#28 Python #1369

grisales54 opened this issue Oct 5, 2024 · 0 comments

Comments

@grisales54
Copy link

`
def ortogonales(v1, v2):

# Comprobamos si los vectores tienen la misma longitud
if len(v1) == len(v2):
    # condición de si son perpediculares
    if v1[0] * v2[0] + v1[1] * v2[1] == 0:

        return True

    else:
        return False
else:
    # Mensaje si no tienen la misma longitud
    return print("Los vectores no tienen las misma longitud")

if ortogonales([4 / 3, 2], [-3 / 2, 1]):
print("Los vectores son ortogonales")

else:
print("No son ortogonales")
`

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