I'm trying to create a function that accepts two numbers and returns the product or the number zero if the result is negative.
I wrote the following code
What am I doing wrong
?
I wrote the following code
def mul_2nums(): x = raw_input('write first number: ') y = raw_input('write second number: ') return x, y def multiply(): x = b y = a print a * b if a * b < 0: print 0 multiply(x,y)And i get - NameError: name 'x' is not defined
What am I doing wrong
?