Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- def sumar(a,b):
- """Script que toma como argumentos dos numeros y retorna su suma"""
- if not isinstance(a,(int,float)) or not isinstance(b,(int,float)):
- raise TypeError("Debes usar números como parámetros")
- return a+b
- print(sumar(2,3))
- print(sumar("2","3"))
- print(sumar([1,2,3],[45,4]))
Advertisement
Add Comment
Please, Sign In to add comment