Skip to content

Instantly share code, notes, and snippets.

@EkremDincel
EkremDincel / algoritmalar.py
Last active March 1, 2020 15:53
İlginç soruları çözmek için kullanılabilecek fonksiyonlar.
import math
##############
def ebob(x,y):
while y:
r, x = x, y
y=r%y
return x
@EkremDincel
EkremDincel / set vs list.py
Created February 23, 2020 17:47
Python comparison of set and list performance
from timeit import timeit as _timeit
uzunluk = 10000
orta = int(uzunluk / 2)
s_number = uzunluk
l_number = uzunluk
timeit = lambda code, number = 1000: _timeit(code, globals = globals(), number = number)
@EkremDincel
EkremDincel / urllibexample.py
Last active February 10, 2020 19:42
urllib code example
from urllib.request import urlopen, Request
from bs4 import BeautifulSoup
rootlink = 'https://www.transfermarkt.pl' # root link of website
link = 'https://www.transfermarkt.pl/schnellsuche/ergebnis/schnellsuche?query=' # our link, as you know
def create_request(url): # let me explain it below
req = Request( # we are creating a Request instance
url, # giving our 'url'
data=None, # this is not important for now :D
@EkremDincel
EkremDincel / builtinmodules.py
Created January 24, 2020 12:34
Python standard library attributes
import collections
import importlib
import inspect
import sys
from stdlib_list import stdlib_list
MODULES = stdlib_list("3.8")
def gettype(x):
if inspect.ismodule(x): return "module"