Skip to content

Instantly share code, notes, and snippets.

View jamilnoyda's full-sized avatar
🏠
Working from home

jamil noyda jamilnoyda

🏠
Working from home
View GitHub Profile
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
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: ")
import sys
input_list = []
count = 0
for line in sys.stdin:
input_list.append(line)
count += 1
if count == 2:
break
l = [
1,
2,
3,
3,
3,
4,
4,
4,
5,
# 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')
from turtle import mainloop
from unittest import main
class Observable:
def __init__(self):
self._observers = []
def register_observer(self, observer):
self._observers.append(observer)
class Node:
def __init__(self, value) -> None:
self.value = value
self.next = None
class SingleList:
def __init__(self) -> None:
self.head = None
@jamilnoyda
jamilnoyda / 1.srp.py
Created April 20, 2022 17:17 — forked from dmmeteo/1.srp.py
SOLID Principles explained in Python with examples.
"""
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):
# bad import
from sqlalchemy import Boolean, Column, create_engine, DateTime, ForeignKey, Integer, MetaData, String, Table, Text
# good import
from sqlalchemy import (
Boolean,
Column,
create_engine,
DateTime,
ForeignKey,
#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
"""