文中の単語をスクランブルし、異なる順序の文字列を返すコードを作成しようとしています
from random import shuffle
def scramble():
a=len("this is a sentence")
for i in range(a):
random.shuffle("this is a sentence")
print(random.shuffle)
正しい軌道に乗っているかどうかはわかりませんが、ループが問題である可能性があると思います
文中の単語をスクランブルし、異なる順序の文字列を返すコードを作成しようとしています
from random import shuffle
def scramble():
a=len("this is a sentence")
for i in range(a):
random.shuffle("this is a sentence")
print(random.shuffle)
正しい軌道に乗っているかどうかはわかりませんが、ループが問題である可能性があると思います