Question about paranthesis | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Question about paranthesis

So in the basic concepts for python 3 class, other numerical operations, it had print(1+3)**2. Why is the parathesis not like this: print(1+3)**2)?

23rd Aug 2020, 1:05 AM
Sahiba Kaur
Sahiba Kaur - avatar
5 Answers
+ 4
both are invalid. In python 3, it is, print((1+3)**2)
23rd Aug 2020, 1:31 AM
M Tamim
M Tamim - avatar
+ 3
Sahiba Kaur which class? please share a link. [the class may be on python 2]
23rd Aug 2020, 9:53 AM
M Tamim
M Tamim - avatar
+ 2
Sahiba Kaur it will work in python 2 but not in python 3 Python 2: print (1+3)**2 Python 3: as suggested by Jan Markus and M Tamim
23rd Aug 2020, 7:19 AM
AKSHAY🇮🇳
AKSHAY🇮🇳 - avatar
0
Ah, thanks! So in the class, why did it have print(1+3)**2?
23rd Aug 2020, 3:28 AM
Sahiba Kaur
Sahiba Kaur - avatar