Ask Question
2 October, 11:41

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

+3
Answers (1)
  1. 2 October, 14:44
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers