Created
September 16, 2016 16:23
-
-
Save mcrisc/4ffeb174aede365ed3f716e96cdba52e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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