python For this part you will be writing a series of functions that can be used
ID: 3936918 • Letter: P
Question
python
For this part you will be writing a series of functions that can be used as part of a "secret message encoder" program. Here are the functions you will be writing as well as some sample code that you use use to test your work. # function : addletters # input: a word to scramble (String) and a number of letters (integer) # processing: adds a number of random letters (A-Z; a-z) after each letter - in the supplied word. for example, if word-"cat" and num-1 we could generate any of the following: cZaQtR cWaRts cEaett if word-"cat" and num-2 we could generate any of the following: cRtaHFtui cnnaNYtjn czAaAitym # output: returns the newly generated wo rd def add_letters(word, num): # function code goes here!Explanation / Answer
import random def add_letters(word,num): scrambledword='' for character in word: scrambledword+=character for number in range(num): randletter=random.randint(65,122) while randletter>90 and randletterRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.