I have taken the following source code from this link, and modified it slightly to replace pass in Polygon with a method noofsides():
pass
Polygon
noofsides()