fork download
  1. import random
  2.  
  3. w="dbera"
  4. key = "abcdefghijklmnopqrstuvwxyz"
  5. random.shuffle(key)
  6. print(key)
  7. for i in range(0, 5):
  8. for j in range(0, 26):
  9. if key[j]==w[i]:
  10. #w = w[:i] + chr(j + 65) + w[-1 * (len(w) - (i + 1)):]
  11. print(w)
Runtime error #stdin #stdout #stderr 0.13s 23748KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 5, in <module>
  File "/usr/lib/python3.7/random.py", line 278, in shuffle
    x[i], x[j] = x[j], x[i]
TypeError: 'str' object does not support item assignment