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):
- if not isinstance(a, (float,int)) or not isinstance(b, (float,int)):
- raise TypeError("Los argumentos deben ser numéricos")
- return a+b
- print(sumar(2,3))
- print(sumar("Hola","Chau"))
- print(sumar((2,3),(4,5)))
- """
- try:
- f = open("uno.txt","x")
- except FileExistsError:
- f = open("uno.txt", "a")
- else:
- print("Se creó un nuevo archivo...")
- finally:
- f.write("Chau\n")
- f.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement