Advertisement
teslariu

range.py

Apr 6th, 2021
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. #
  4.  
  5. for numero in range(11): # inicio 0 (default), tope 11, salto 1 (default)
  6.     print(numero, numero**2)
  7.    
  8. print()
  9.  
  10. for numero in range(5,11): # inicio 5, tope 11, salto 1 (default)
  11.     print(numero, numero**2)
  12.    
  13. print()
  14.  
  15. for numero in range(-2,84,11): # inicio -2, tope 84, salto 11
  16.     print(numero, numero**2)
  17.  
  18. """
  19. range(tope)                 inicio por default igual a 0, salto por default igual a 1
  20. range(inicio, tope)         salto por default igual a 1
  21. range(inicio, tope, salto)
  22.  
  23. """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement