When I copy code in List 5.1 and run in jupyter, it always tells me this:
Can't get attribute 'square' on <module 'main' (built-in)>
According to what I have found in Google, it seems that the code needs to be titled:
if name =='main':
but this way only works in Spyder and Pycharm.
So I wanna know how you guys tackle it.
Grateful to hear any suggestions!