@valoro/

aleatorios_con_excepciones_3

Python

http://altocodigo.blogspot.com/2018/08/aleatorios-con-excepciones.html

fork
loading
Files
  • main.py

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.6217097270687075","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"IyBHZW5lcmFyIG7Dum1lcm9zIGFsZWF0b3Jpb3MgcGFyZXMgZW50cmUgMTAwIHkgMTMwLCBzYWx2byAxMTAgeSAxMjAuCiMgY29uIHJlcGV0aWNpw7NuCmZyb20gcmFuZG9tIGltcG9ydCByYW5kaW50CkwgPSBbaSoyIGZvciBpIGluIFtyYW5kaW50KDUwLDY1KSBmb3IgaiBpbiByYW5nZSgxNildIGlmIGkgbm90IGluICg1NSw2MCldCnByaW50KEwpCnByaW50KHNvcnRlZChMKSk="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
# Generar números aleatorios pares entre 100 y 130, salvo 110 y 120.
# con repetición
from random import randint
L = [i*2 for i in [randint(50,65) for j in range(16)] if i not in (55,60)]
print(L)
print(sorted(L))