In: Computer Science
Please answer using python 3 and def functions!
Lab 2 Drill 3: (function practice) create and use a function named highest() that takes three inputs and returns the highest number. After you have got it working, try calling the function with inputs ‘hat’, ‘cat’, ‘rat’.
ANSWER: Here I am giving you the code and output please like it if you still have any doubt then comment on it before going to downvote.
CODE:
num1 = input("Enter first number: ")
num2 = input("Enter second number: ")
num3 = input("Enter third number: ")
def highest(num1,num2,num3):
if (num1 > num2) and (num1 > num3):
largest = num1
elif (num2 > num1) and (num2 > num3):
largest = num2
else:
largest = num3
return largest
print("The largest number is",highest(num1,num2,num3))
CODE & OUTPUT: