fork download
  1. # your code goes here
  2.  
  3. x = ['one', 'two', 'three', 'four', 'five', 'six']
  4. z = []
  5.  
  6. while len(z) != len(x):
  7. y = random.choice(x)
  8. if y not in z:
  9. z.append(y)
  10. print()
  11. print(z)
  12.  
  13. x = ['one', 'two', 'three', 'four', 'five', 'six']
  14. z = []
  15. for i in range(len(x)):
  16. y = random.choice(x)
  17. if y not in z:
  18. z.append(y)
  19.  
  20.  
  21. print()
  22. print(z)
Runtime error #stdin #stdout #stderr 0.01s 27664KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 7, in <module>
NameError: name 'random' is not defined