[Solved] Easy class questions on joining


Assuming the language required is Python,

comparison_result = ""
if num1 > num2:
    comparison_result = ">"
elif num1 < num2:
    comparison_result = "<"
else:
    comparison_result = "="
the_text = "The sum of " + str(num1) + " and " + str(num2) + " is " + str(num1 + num2) + " and " + str(num1) + comparison_result + str(num2)

You just need to typecast the int as str.

6

solved Easy class questions on joining