We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 435d9db commit cc0de2eCopy full SHA for cc0de2e
if_set1_3.py
@@ -0,0 +1,15 @@
1
+# Write a program that prompts the user for two numbers and then computes them using the following rules.
2
+# If the first number is greater than the second one, the second number is subtracted from the first one.
3
+# If the second number is greater than the first one, the first number is divided by the second one.
4
+# Otherwise, the two numbers are added.
5
+num1 = int(input("Enter first number: "))
6
+num2 = int(input("Enter second number: "))
7
+
8
+if num1 > num2:
9
+ print("num1 - num2 = " + str(num1-num2))
10
+elif num1 < num2:
11
+ print("num2 // num1 = " + str(num1 / num2))
12
+else:
13
+ print("Num1 + num2 = " + str(num1 + num2))
14
15
0 commit comments