Skip to content

Instantly share code, notes, and snippets.

@mcrisc
Created September 16, 2016 16:23
Show Gist options
  • Save mcrisc/4ffeb174aede365ed3f716e96cdba52e to your computer and use it in GitHub Desktop.
Save mcrisc/4ffeb174aede365ed3f716e96cdba52e to your computer and use it in GitHub Desktop.
def mycosine(v1, v2):
"""
Calcular o cosseno do ângulo theta, formado pelos vetores v1 e v2.
"""
raise NotImplementedError
# -- BEGIN: não alterar --
try:
assert mycosine([0, 2], [5, 0]) == 0
assert mycosine([3, 1, 6], [9, 3, 18]) == 1
assert mycosine([3, 1], [3, 3]) > mycosine([1, 4], [3, 1])
print('OK')
except AssertionError:
print('Implementação incorreta')
except NotImplementedError:
print('Implemente a função mycosine()')
# -- END: não alterar --
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment