0
3 positive integers. Find max. I'm having trouble with the input validation coding and combining it with max code.
4 Respostas
+ 3
def inputValidation(a,b,c):
if a > 0 and b > 0 and c > 0:
return 1
else:
return 0
def maximumFunction(a,b,c):
maximum = a
if b > maximum:
maximum = b
if c > maximum:
maximum = c
if b > c:
maximum = b
return maximum
#def main:
# Use int() to convert input to integer when
# requesting user input.
a,b,c = 7,12,9
if inputValidation(a,b,c)==1:
print("Maximum value is",maximumFunction(a,b,c))
else:
print("Invalid input!")
# Hth, cmiiw
+ 1
Thank you very much for the assistance!