You are on page 1of 1

Algorithm_1

while True:
num1 = input("Enter the First Number: ")

num2 = input("Enter the Second Number: ")

if num1 > num2 :


print("num1 is Greater than num2")
elif num1 < num2:
print("num1 is Less than num2")
else:
print("num1 and num2 are Equal")

Name1 = input("Enter the First Classmate: ")


Name2 = input("Enter the Second Classmate: ")
Name3 = input("Enter the Third Classmate: ")

Name = [Name1, Name3, Name2]


print("Here are My Classmate Names")
print(Name)

Algorithm_2

def greaterThan(n1, n2):


if n1 > n2 :
return "The n1 is Greater than n2"
else:
return lessThan(n1, n2)

def lessThan(n1, n2):


if n1 < n2:
return "The n1 is Less than n2"
else:
return Equal(n1, n2)

def Equal (n1, n2):


if n1 == n2:
return "The n1 and n2 are Equal"
else:
return greaterThan (n1, n2)

while True:
n1 = int(input("Enter the First NUmber: "))
n2 = int(input("Enter the Second Number: "))

if greaterThan(n1, n2):
print(str(greaterThan(n1, n2)))
else:
lessThan(n1, n2)
print(str(lessThan(n1, n2)))

You might also like