This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Lista de numeros primos entre 1 y 100 en una sola linea | |
| c = [i for i in xrange(2,101) if (i%2!=0 or i==2) and (i%3!=0 or i==3) and (i%5!=0 or i==5) and (i%7!=0 or i==7)] | |
| print c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #eleccion.py | |
| """ | |
| Este script soporta ser reiniciado varias veces, guardando los cambios cada vez | |
| """ | |
| from random import shuffle, choice | |
| if __name__ == "__main__": | |
| print "+--------------------------------+" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #eleccion.py | |
| from random import shuffle, choice | |
| # La funcion shuffle del modulo random puede revolver una lista de forma aleatoria | |
| # La funcion choice escoje de forma aleatoria un elemento de una lista | |
| if __name__ == "__main__": | |
| print "+--------------------------------+" | |
| print "! Sistema de eleccion !" | |
| print "! Aleatoria !" |
NewerOlder