0
What am I doing wrong ! :(
import random a = random.randint(1,150) b = random.randint(-150,150) answer = a + b print(a + b) if a + b >= 0: print (answer("is a positive number!") elif a + b <= 0: print (answer("is a negative number!") File "source_file.py", line 11 elif a + b <= 0: ^ SyntaxError: invalid syntax
3 ответов
+ 11
You should do this like this :
https://code.sololearn.com/cuD9E96NL367/?ref=app
+ 2
You forgot a closing parenthesis ) before the elif
There's also another missing parenthesis at the end of line 12
EDIT: I didn't see it initially, answer is not a function, which means you can't do answer(argument). Answer is a variable. Or am I missing something?
0
Thank you! :) it worked