Tag Archives: Pythons

Classmethod vs Staticmethod in Python’s OOP – Python Dev Feed

Classmethod vs Staticmethod in Python’s OOP class Area: #defining an area classdef init(self,wt,ht):self.ht= htself.wt= wtdef area(self): #defining a simple rect area methodreturn self.wt*self.ht @classmethod def sqr(cls,sd): #defining a square method to take advantage of the rect area method return cls(sd,sd) Enter fullscreen mode Exit fullscreen mode class Tri(Area): #defining a triangle class to inherit from…

Read More

Python Basics, Pythons 101! – Python Dev Feed

Python Basics, Pythons 101! What is Python? Python is an interpreted high-level general-purpose programming language. It’s design philosophy emphasizes code readability with its notable use of significant indentation.Python is dynamically-typed and garbage-collected as it supports multiple programming paradigms, including structured, object-oriented and functional programming. It was developed by Guido van Rossum who started working on…

Read More