How to scramble the words in a sentence - Python
问题 I have created the following code to scramble the letters in a word (except for the first and last letters), but how would one scramble the letters of the words in a sentence; given the input asks for a sentence instead of a word. Thank you for your time! import random def main(): word = input("Please enter a word: ") print(scramble(word)) def scramble(word): char1 = random.randint(1, len(word)-2) char2 = random.randint(1, len(word)-2) while char1 == char2: char2 = random.randint(1, len(word)