By code it is clear that the variables a and b will be received from user input ( input function). Therefore, it makes no sense to pass these variables as function arguments. Here is an example:
def minimum(): a = int(input('Type number a: ')) b = int(input('Type number b: ')) if a > b: print (b) elif a == b: print ('a equals to b') else: print (a) minimum()
If you do not need to receive these variables from user input, then you do not need to use the input function. And variables a and b need to be transferred manually. Here is an example:
def minimum(a, b): if a > b: print (b) elif a == b: print ('a equals to b') else: print (a) minimum(5, 1)
Specifically, the error that gives you indicates that the variable you are trying to use does not exist yet.
minimum(a, b)
When calling a function, there is no variable neither a nor b . They will be defined only locally, inside this function, after its call.