我已经创建了以下代码来打乱单词中的字母(第一个和最后一个字母除外),但是如何拼写一个句子中单词的字母;因为输入要求输入一个句子而不是一个单词。感谢您的时间! import random
def main():
word = input("Please enter a word: ")
print(scramble(word))
def scramble(word):
我想将一个句子拆分为一个段落,并且每个段落的单词数量应该少于几个。例如: Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old.
我想写这将争夺词语的句子,并返回一个字符串,它以不同的顺序 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)
不知道如果我