Given two integers, num1 and num2, you need to determine whether num1 is greater than, less than, or equal to num2 and assign the result to the variable 'comparison_result'. Fill the blanks in the given code that accomplish this comparison and correctly assign the result. Remember, the valid Boolean comparisons in Python are >, < and ==.
Comparing two integers in Python
Report a typo
Fill in the gaps with the relevant elements
num1 = 10
num2 = 20
comparison_result = ""
num1 > num2:
comparison_result = "num1 is greater than num2"
num1 < num2:
comparison_result = "num1 is less than num2"
:
comparison_result = "num1 is equal to num2"
print(comparison_result) ___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.