Question: Question 1 4 1 Point Use the debugger in your IDE of choice to answer these questions. Set a breakpoint on the return line, then

Question 14
1
Point
Use the debugger in your IDE of choice to answer these questions. Set a breakpoint on the return line, then use the variable explorer to find the requested values.
import random, sys
random.seed(658)
sys.setrecursionlimit(1000000)
def foo(counter=0):
"""Generates random numbers until we get a 50"""
# Track how many calls we've made
counter +=1
random_number = random.randint(1,100)
if random_number ==50:
return
foo(counter)
foo()
1) What is the value of counter when the first return statement is executed? Blank 1
2) What is the value of random_number one foo call before random.randint() returns 50? Blank 2
3) What is the value of random_number three foo calls before random.randint() returns 50? Blank 3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!