Python program to check which number is greater among two numbers
Answers
Answered by
16
Answer:
num1=int(input("enter the first number:"))
num2=int(input("enter the second number:"))
if num1>=num2:
large=num1.
else:
large=num2.
print("the largest number is:",large)
Output:
Answered by
14
The following codes must be typed in script mode, saved and then executed.
Here, we'll be using the IF - ELSE function. It is a function that decides the result based on a given condition.
It will run the body of the code, only if the condition is true. Otherwise, the 'else' code of the value inputted will be executed.
CODE:
x = int(input("Enter a value:"))
y = int(input("Enter a second value:"))
if x>y:
print(x, "is the greater value.")
else:
print(y, "is the greater value.")
OUTPUT:
Attachments:
Similar questions
Math,
6 months ago
Hindi,
6 months ago
Science,
1 year ago
English,
1 year ago
Computer Science,
1 year ago