Guest User

Untitled

a guest
Jan 20th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. import math
  2.  
  3. def listaraicescuadradas(Listanumeros):
  4. """
  5. la funcion devuelve una lista con la raiz cuadrada
  6. de los elementos pasados en otra lista por argumentos.
  7. >>> lista = []
  8. >>> for i in [4, -9, 16]:
  9. ... lista.append(i)
  10. >>> listaraicescuadradas(lista)
  11. Traceback (most recent call last):
  12. ...
  13. ValueError: math domain error
  14.  
  15.  
  16. """
  17. return [math.sqrt(n) for n in Listanumeros ]
  18.  
  19. import doctest
  20.  
  21. doctest.testmod()
  22.  
  23. ValueError: line 12 of the docstring for __main__.listaraicescuadradas has inconsistent leading whitespace: 'ValueError: math domain error
Add Comment
Please, Sign In to add comment