0
How can Python compare two different solutions in a program and make it print out the best one (eg. the lowest price)?
Looking for ideas and tips
3 Réponses
+ 1
You can use the built-in function min:
print(min(x, y))
Or you can define a new function:
def s(x, y):
if(x<y):
return x
return y
0
I don't understand your question, what do you mean exactly ?
0
Let's say i have two different numbers infront of me. But i always want the system to choose the lowest number and print it out.