Multilevel inheritance in python A program as an example. Code - -------------------------------- class ElectronicDevice: refrigerator = 1000 def __init__(self, name, watt): self.name = name self.watt = watt def rupee_checker(self): a = 283 if self.watt < 1000: return f"Your Electrical Device consumes less than {a} units per year." elif self.watt > 1000: return f"Your Electrical Device consumes more than {a} units per year." elif self.watt == 1000: return f"Your Electrical Device consumes {a} units per year." class PocketGadget(ElectronicDevice): MaH = 3000 def __init__(self, name, mah): se...
Git Commands This is a complete list of commands which you will need to keep in mind. While using git. git confing --global user.name anant = For setting name for first time git confing --global user.email xyz@gmail.com = For setting Email. git config --global user.name = For getting name git config --global user.email = For getting email git init = For making the git repository at that directory. git add --a OR git add -A = For adding all untracked files to work stage git commit -m "Second commit new features added" = for committing the stage files repository. git status = For looking untracked files or not committed files on repository. git log = For looking all history commit's. rm -rf .git = For deleting all info about that repository which were in .git folder. ls = For looking all files in present working directory. pwd = For looking present working directory. git clone [Link of a repository from github] = For cloning means to download a copy from github to your pw...
Function cashing and drinking water Desktop notification system. Code - --------------------------------------------- import time from functools import lru_cache from plyer import notification @lru_cache ( maxsize = 5 ) def nacho (n): time.sleep(n) return n # if __name__ == '__main__': # print("Ek run ho hai") # print(nacho(3)) def water_drinker (): print ( "This Water notification system." ) while True : time.sleep( 15 ) notification.notify( title = "** It's water time **" , message = "Drink 1 glass of water from your bottle.... And enjoy programming..." , app_icon = "full path.ico" , timeout = 10 ) water_drinker()
Comments
Post a Comment