teslariu

doc func

Sep 20th, 2022
1,032
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. #
  4. # Documentación de funciones
  5. """
  6. Script que muestra como documentar funcio9nes en Python
  7.  
  8. """
  9.  
  10. def suma(a,b):
  11.     """Función que toma como parámetros dos nros
  12.    y devuelve su suma"""
  13.     return a+b
  14.    
  15. def resta(a,b):
  16.     """Función que toma como parámetros dos nros
  17.    y devuelve su resta"""
  18.     return a-b
  19.    
  20.    
  21. print(suma(12,15))
  22. print(resta(11,15))
  23.  
Advertisement
Add Comment
Please, Sign In to add comment