Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Homework for Python 1. SCOPE: This program uses the symbol \"count\" many times.

ID: 3748700 • Letter: H

Question

Homework for Python 1. SCOPE: This program uses the symbol "count" many times. (a) Find the first use of "count" in the program. I've written a "off to the left of that line. You should write a "1" left of each line that uses "count to mean this object/symbol (b) Once you've completed step (a), find the first use of "count" that is NOT labeled with a "1.Label that line with a "2". Also write a "2" by each line that uses "count" to refer to this object. (c) Once you've completed step (b), find the first use of "count" that is NOT labeled with either a "1" or a "2". and label that line with a 3" instead. Also write a "3" by each line that uses "count" to refer to this object. (d) I'll assume that all other uses of"count" are other 1 count-33 def fncl (count): if count>30: print( That's big.") elif count0 for count in range(0, 10): print(count, end printo print("That's negative") print f Thanks for asking about fcount).") def fne2(x): def print separator: for count in range(0, 50): print("*"" end="") printo count 0 given = x while x >0: ifx % 10-0: count1 print separator0 print(f We found (count multiples of 10 from 1 to given).") print separator fnel (count-10) print(f inNow countcount fnc2(count 10) print(nFinally, count- count)"

Explanation / Answer

1 count=33

2 def fnc1(count)

2 if count>30:

print("That's big")

2 elif count>=0:

2 for count in range(0,10):

2 print(count,end=" ")

print()

else:

print("That's negative")

2 print("Thanks for asking about {count}")

def fnc2(x):

def print_separator():

3 for count in range(0,50):

print("*",end="")

print()

3 count=0

given=x

while x>0:

if x%10==0:

3 count+=1;

x-=1

print_separator()

3 print("We found {count} multiples of 10 from 1 to {given}")

print_separator()

1 fnc1(count-10)

print(" Now count={count}")

1 fnc2(count+10)

print(" Finally count={count}")

Explanantion

Count which is marked with 1 is the variable which can be accessed from everywhere

Count which is marked with 2 is of the function fnc1 and it is local to the function

Count which is marked with 3 is of the function print_separator() and it is local to the function