teslariu

funciones integradas

Jul 8th, 2023
891
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3.  
  4. # simulo una cuenta regresiva de una bomba
  5. import time
  6.  
  7. for tiempo in range(5,0,-1):
  8.     print(tiempo)
  9.     time.sleep(1)
  10. print("BOOM")
  11.  
  12.  
  13. # simulo 15 tiradas de dados
  14. import random
  15. for _ in range(15):
  16.     print(random.randint(1,6), end=",")
Advertisement
Add Comment
Please, Sign In to add comment