This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Single Responsibility Principle | |
“…You had one job” — Loki to Skurge in Thor: Ragnarok | |
A class should have only one job. | |
If a class has more than one responsibility, it becomes coupled. | |
A change to one responsibility results to modification of the other responsibility. | |
""" | |
class Animal: | |
def __init__(self, name: str): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node: | |
def __init__(self, value) -> None: | |
self.value = value | |
self.next = None | |
class SingleList: | |
def __init__(self) -> None: | |
self.head = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from turtle import mainloop | |
from unittest import main | |
class Observable: | |
def __init__(self): | |
self._observers = [] | |
def register_observer(self, observer): | |
self._observers.append(observer) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# a,b,c =1,2,3 | |
# print(a) if a>b else print(b) if (b>c) else print(c) | |
# l =[x for x in range(0,10,14)] | |
# print(l) | |
# a=1 | |
# a=[1,2,3] | |
# b = a | |
# a.append('b') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
l = [ | |
1, | |
2, | |
3, | |
3, | |
3, | |
4, | |
4, | |
4, | |
5, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
input_list = [] | |
count = 0 | |
for line in sys.stdin: | |
input_list.append(line) | |
count += 1 | |
if count == 2: | |
break |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import date, timedelta | |
print("enter date in this fromat year month date[yyyy mm dd]") | |
sdate = input("enter start date: ") | |
edate = input("enter end date: ") | |
print( | |
"enter exact this words for weekday sunday monday tuesday wednesday thursday friday saturday" | |
) | |
weekday = input("enter weekday: ") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node: | |
def __init__(self, data=None, next=None): | |
# self.curr = None | |
self.data = data | |
self.next = next | |
def get_data(self): | |
return self.data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#bad | |
def create_from_partner_onboarding( created_by, pipeline_id, pipeline_type, doc_id, doc_name, count=1): | |
pass | |
def create_from_partner_onboarding( | |
created_by, pipeline_id, pipeline_type, doc_id, doc_name, count=1 | |
): | |
""" | |
good one | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def names(): | |
pass | |
def hello_world(): | |
pass | |
def hey_hello_world(): | |
pass |
NewerOlder