Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello! I need help with this following Python question.. Thank you in advance! The cell below includes a function court_jester_jokes that has been provided for

Hello! I need help with this following Python question.. Thank you in advance!

image text in transcribed
The cell below includes a function court_jester_jokes that has been provided for you. After understanding the code in the function, run the cell below (to define this function). Then, execute (use) this function to create the following variables under the specified conditions: 1. joke_random I execute the court_jester_jokes function to return a joke at random 2. joke_nonrandom I execute court_jester_jokes to return the second joke in joke_1ist 1 import random 2 3 def court_jester_jokes(random_joke=1'rue): 4 joke_list = ['A clown held the door open for me yesterday. I thought it was a nice jester' , 5 'How does the court jester address the King of Ducks? Mal'Lard', 6 'What did the court jester call the balding crown prince? The Heir Apparent with no Hair Apparent' 7 'What do you call a joke made by using sign language? A jester'] 8 if random_joke: 9 out_joke = random.choice(joke_list) 10 else: 11 out_joke = joke_list[1] 12 13 return out_joke

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Programming questions

Question

What are two main components of a CPU?

Answered: 1 week ago