+ 1

I tried executing, >>>2**2 on Python and it's showing me error please am I doing anything wrong

19th Nov 2016, 7:00 PM
otokiniye
otokiniye - avatar
5 odpowiedzi
+ 3
Python accepts statements at the >>> prompt (for immediate execution). You don't type the >>>; that's there to tell you the interpreter is what's being used. >>> 2**2 4 I typed 2**2. You don't need print; when there's no other clear purpose, Python assumes you want the value of things you type: >>> a=3 # assignment; not printed >>> a # you must want to know 'a' 3
19th Nov 2016, 9:59 PM
Kirk Schafer
Kirk Schafer - avatar
0
your are suppose to start with print. The answer is print (2**2) and no errors will come out.
19th Nov 2016, 8:00 PM
april_gmw
april_gmw - avatar
0
Thanks bro
19th Nov 2016, 8:40 PM
otokiniye
otokiniye - avatar
0
check once again ...if you are getting error please paste error... becoz u should get 4 as a answer without using print function
19th Nov 2016, 9:02 PM
harish g
0
your suppose to start with print. Answer is print (2**2) and you will have no errors
20th Nov 2016, 1:17 PM
Nasim Ahamed Rifat
Nasim Ahamed Rifat - avatar