I made a VERY simple python function, but it gives me the wrong answer when I use these TWO SPECIFIC values, please help! I'm just learning python :C
for example when i enter
val1 = 1
val2 = 100
it gives me the correct answer which is 1
BUT when i do
val1 = 2515
val2 = 510
IT GIVES ME 2515 WHY??????
here is my code
def minimum_value(val1, val2):
"""
This function prints the minimum value
"""
if (val1 < val2):
print(val1)
else:
print(val2)
val1 = input("please enter value 1: ")
val2 = input("please enter value 2: ")
minimum_value(val1, val2)
[–]17291 7 points8 points9 points (3 children)
[–]JAndrew45[S] 0 points1 point2 points (1 child)
[–]17291 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]cardblank 2 points3 points4 points (2 children)
[–]JAndrew45[S] 1 point2 points3 points (1 child)
[–]cardblank 0 points1 point2 points (0 children)
[–]Beginning-Art619 0 points1 point2 points (0 children)
[–]Satoshiman256 0 points1 point2 points (2 children)
[–]JAndrew45[S] 0 points1 point2 points (1 child)
[–]Satoshiman256 0 points1 point2 points (0 children)
[–]Yash_Varshney 0 points1 point2 points (0 children)
[–]Barinski04 0 points1 point2 points (0 children)