import random w="dbera"key = "abcdefghijklmnopqrstuvwxyz"random.shuffle(key)print(key)for i in range(0, 5): for j in range(0, 26): if key[j]==w[i]: #w = w[:i] + chr(j + 65) + w[-1 * (len(w) - (i + 1)):] print(w)
Standard input is empty
Standard output is empty
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
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!