Jan-02-2020, 12:59 PM
I'm self teaching python and need a bit of help . I'm trying to figure out why my code gives me a syntax error.
I know the answer is 5 but when I try to run the code I get
1 2 3 4 5 6 7 8 9 10 11 |
def max_num(num1, num2, num3): if num1 > = num2 and num1 > = num3: return num1 elif num_2 > = num1 > = num3: return num2 else : return num3 print (max_num( 3 , 4 , 5 )) |
1 2 3 4 5 6 7 8 9 10 |
Traceback (most recent call last): File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py" , line 31 , in <module> start(fakepyfile,mainpyfile) File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py" , line 30 , in start exec ( open (mainpyfile).read(), __main__.__dict__) File "<string>" , line 11 , in <module> File "<string>" , line 4 , in max_num NameError: name 'num_2' is not defined [Program finished] |