@valoro/

ordenar_numeros1

Python

https://altocodigo.blogspot.com/2018/08/generar-numeros-aleatorios-sin.html

fork
loading
Files
  • main.py

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.9130649858775362","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"aW1wb3J0IHJhbmRvbQpkZWYgdW5pY28oeCxMKToKICBlc1VuaWNvPVRydWUKICBmb3IgaSBpbiByYW5nZShsZW4oTCkpOgogICAgaWYgeD09TFtpXToKICAgICAgZXNVbmljbz1GYWxzZQogICAgICBicmVhawogIHJldHVybiBlc1VuaWNvCkw9W10Kaj0wCndoaWxlIGo8MTA6CiAgeD1yYW5kb20ucmFuZGludCg4MCw5OSkKICBpZiB1bmljbyh4LEwpOgogICAgTC5hcHBlbmQoeCkKICAgIGorPTEKcHJpbnQoTCkKTC5zb3J0KCkKcHJpbnQoTCk="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import random
def unico(x,L):
  esUnico=True
  for i in range(len(L)):
    if x==L[i]:
      esUnico=False
      break
  return esUnico
L=[]
j=0
while j<10:
  x=random.randint(80,99)
  if unico(x,L):
    L.append(x)
    j+=1
print(L)
L.sort()
print(L)