Im struggling to fix my code for a prompted assignment. Sometimes it gives the correct answers, other times it doesn't. For whatever reason, the input "12, 18, 4, 9" gives a max of 12?
def max_number(num1, num2, num3, num4):
if (num1 > (num2 and num3 and num4)):
return num1
elif (num2 > (num3 and num4)):
return num2
elif num3>num4:
return num3
else:
return num4
def min_number(num1, num2, num3, num4):
if num1<(num2 and num3 and num4):
return num1
elif num2<(num3 and num4):
return num2
elif num3<num4:
return num3
else:
return num4
if __name__ == '__main__':
num1 = int(input())
num2 = int(input())
num3 = int(input())
num4 = int(input())
print('Maximum is', max_number(num1, num2, num3, num4))
print('Minimum is', min_number(num1, num2, num3, num4))