Computer Science, asked by diljotsinghdhillon, 1 year ago

Python program to check which number is greater among two numbers​

Answers

Answered by mansijaiswal13112006
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 Equestriadash
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