could anyone explain why do I get the 'None'? Thanks
You must be logged in to post. Please login or register an account.
Hi feng,
You are getting 5 & None as output because, after the first print(x) 5 is getting printed and in python print() takes cursor to new line and this new line is going as input to second print() statement. So that is why None is getting printed.
For more details, in IDLE go to Debug->Debugger and on the IDLE prompt type the above statements then there are 4 options "GO","Step","Over","Out","Quit". Hit Step Option and it will go inside the "write()" function present inside the "Python->Python36-32->lib->idlelib->run.py" file.
When you do "type("n")" it will print "<class,str>" this why None is getting printed.
Hope I have cleared your doubt.
-kunal_py_prg 7 years ago
Last edited 7 years ago
You must be logged in to post. Please login or register an account.