Course Solutions Uncategorized (Solved) : Import Randomfaveword3 Catz Add World Random Number 0 3 Bob S Wordfaveword3 World Randnum Q34949568 . . . .

(Solved) : Import Randomfaveword3 Catz Add World Random Number 0 3 Bob S Wordfaveword3 World Randnum Q34949568 . . . .

 

import randomfave_word_3 = ‘catz’# add ‘world’ and a random number (between 0-3) of ‘Bob’s to this wordfave_word_3 += “world”rand_num = random.randint(0,3)if rand_num == 0: fave_word_3 += ”elif rand_num == 1: fave_word_3 += ‘Bob’elif rand_num == 2: fave_word_3 += ‘BobBob’elif rand_num == 3: fave_word_3 += ‘BobBobBob’else: fave_word_3 += ”print(fave_word_3)

Looking for a way to turn this into a function and cut down onredundant code. (python)

Expert Answer


An answer will be send to you shortly. . . . .

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post