@valoro/

aleatorios_con_excepciones_6

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.7458089894284894","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"IyBHZW5lcmFyIG7Dum1lcm9zIGFsZWF0b3Jpb3MgcGFyZXMgZW50cmUgMTAwIHkgMTMwLCBzYWx2byAxMTAgeSAxMjAuCiMgc2luIHJlcGV0aWNpw7NuCmltcG9ydCByYW5kb20KTD1baSBmb3IgaSBpbiByYW5nZSgxMDAsMTMxLDIpIGlmIGkhPTExMCBhbmQgaSE9MTIwXQpyYW5kb20uc2h1ZmZsZShMKSAjZGVzb3JkZW5hIGxhIGxpc3RhCnByaW50KEwpCnByaW50KHNvcnRlZChMKSk="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
# Generar números aleatorios pares entre 100 y 130, salvo 110 y 120.
# sin repetición
import random
L=[i for i in range(100,131,2) if i!=110 and i!=120]
random.shuffle(L) #desordena la lista
print(L)
print(sorted(L))