Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- def sumar(a,b):
- "Funcion que devuelve la suma de dos nros"
- if not isinstance(a, (int,float)) or not isinstance(b, (int,float)):
- raise TypeError("Los argumentos deben ser números")
- return a+b
- total = sumar("2","3")
- print(total)
- total = sumar(2,3)
- print(total)
- total = sumar((2,),(3,))
- print(total)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement