You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why does this code return 'None' after the 3rd line of Knock Knock? I would suspect the break command would prevent end the output after the 3rd line of Knock Knock
def knock_three_times():
x = 0
while x < 3:
print("Knock Knock")
x += 1
if x == 3:
break
msg = knock_three_times()
print(msg)
The text was updated successfully, but these errors were encountered:
Why does this code return 'None' after the 3rd line of Knock Knock? I would suspect the break command would prevent end the output after the 3rd line of Knock Knock
def knock_three_times():
x = 0
while x < 3:
print("Knock Knock")
x += 1
if x == 3:
break
msg = knock_three_times()
print(msg)
The text was updated successfully, but these errors were encountered: