Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

in the program below, which two variables have the same scope? def rhym…

Question

in the program below, which two variables have the same scope?
def rhyme(word):
leftcharacter = word0
if leftcharacter != d:
return d + word1:
else:
return f + word1:
def poem():
print(\enter q to quit.\)
userword = input(\enter a word: \)
while userword != q and userword != q:
rhymeword = rhyme(userword)
print(rhymeword)
userword = input(\enter a word: \)

the main part of your program that calls the function

poem()
userword and

Explanation:

Brief Explanations

In Python, variables defined within the same function have the same scope. The userWord and rhymeWord variables are both defined within the poem function. They exist only for the duration of the poem function's execution and have the same local - function scope.

Answer:

rhymeWord