+ 1

Problems python3 with multiplication sign

I am in the first basic step of python and when I write this code: print(-7)*(-4) which as far as I understand would give the answer -28 I get this: -7 Traceback (most recent call last): File "./Playground/file0.py", line 1, in <module> print(-7)*(-4) TypeError: unsupported operand type(s) for *: 'NoneType' and 'int' What rookie mistake am I making trying to use the symbol for multiplication? I have tried both * at numbers and at the keyboard.

15th Jun 2020, 8:29 AM
Therese Luthman
Therese Luthman - avatar
5 Answers
+ 3
print((-7)*(-4)) I printed the above statement..and it did not gave any error..and ans is also correct i.e. 28
15th Jun 2020, 8:32 AM
ANJALI SAHU
+ 3
print((-7)*(-4)) Output:28 As negative number * negative number = positive number
15th Jun 2020, 8:33 AM
Muhammad G
Muhammad G - avatar
+ 2
Ok first try to know that print is a function in python 3 so it need parenthesis print() like this but in python 2 no parenthesis was required and if you are using IDE for python3 then you must write it like print((-7)*(-4)).
15th Jun 2020, 8:33 AM
Ayush Kumar
Ayush Kumar - avatar
+ 1
You're missing an enclosing parenthesis to bind what you want to print
15th Jun 2020, 8:37 AM
Mark 🇺🇬
Mark 🇺🇬 - avatar
0
negative*negative=positive positiv*positive=positive negative*positive=negative positive*negative=negative
2nd Jul 2020, 4:49 AM
Pr0C0d3r
Pr0C0d3r - avatar