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
And i get - NameError: name 'x' is not defined
What am I doing wrong
?
I wrote the following code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
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) |
What am I doing wrong
?