Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python - please change the for loops in this program into while loops 1 import random 3 def scramble (word): result word[0] # first one
Python - please change the for loops in this program into while loops
1 import random 3 def scramble (word): result word[0] # first one same 6 if len(word) 2: for i in range(1, len(word)-1): 1.append(i) random. shuffle(1) # shuffling the middle indices 10 for index in 1: 12 13 14 result +-word [index] # changing the letters result +- word[len(word)-1] # last one same 16 17 return result 18 19 text-input("Enter a 20 print("Scrambled word word: ") is", scramble(text))Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started