37.0k views
2 votes
Assume that two variables, varA and varB, are assigned values, either numbers or strings.. . Write a piece of Python code that prints out one of the following messages:. . Choices: A.\"string involved\" if either varA or varB are strings. . B.\"bigger\" if varA is larger than varB. .C. \"equal\" if varA is equal to varB. .

User Paul Guyot
by
7.9k points

1 Answer

2 votes

To answer this programming question:

if isinstance(varA, str) or isinstance(varB, str):

return "string involved"

elif varA > varB:

return "bigger"

elif varA < varB:

return "smaller"

else:

return "equal"

I am hoping that these answers have satisfied your queries and it will be able to help you in your endeavors, and if you would like, feel free to ask another question.

User CR Sardar
by
8.0k points