forked from seeditsolution/pythonprogram
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGreatest python
More file actions
22 lines (21 loc) · 559 Bytes
/
Greatest python
File metadata and controls
22 lines (21 loc) · 559 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Python Program - Find Largest of Two Numbers
print("Enter 'x' for exit.");
print("Enter any two numbers: ");
num1 = input();
if num1 == 'x':
exit();
else:
num2 = input();
number1 = int(num1);
number2 = int(num2);
count = 0;
if number1 > number2:
largest = number1;
count = 1;
elif number1 < number2:
largest = number2;
count = 1;
else:
print("\nBoth the numbers are equal to each other.");
if count == 1:
print("\n Largest of the given two numbers is", largest);