Ask Question
5 August, 09:33

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:

• "string involved" if either varA or varB are strings

• "bigger" if varA is larger than varB

• "equal" if varA is equal to varB

• "smaller" if varA is smaller than varB

+1
Answers (1)
  1. 5 August, 11:38
    0
    StrA = isinstance (varA, str) strB = isinstance (varB, str)

    if strA or strB = = True: print ("String involved.")

    elif varA > varB: print ("bigger")

    elif varA = = varB: print ("equal")

    elif varA < varB: print ("smaller")
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Assume that two variables, varA and varB, are assigned values, either numbers or strings. Write a piece of Python code that prints out one ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers