2. Create a tuple out of them.
3. If the sum of the first and second elements of the tuple is greater than the third, print
the tuple in reverse.
4. Otherwise, print the tuple normally.
Right Answer:
# Step 1
num1 = float(input("Enter first number: "))
num2 = float(input("Enter second number: "))
num3 = float(input("Enter third number: "))
# Step 2
num_tuple = (num1, num2, num3)
# Step 3 and Step 4
if num1 + num2 > num3:
print(num_tuple[::-1]) # Print the tuple in reverse
else:
print(num_tuple) # Print the tuple normally