This file contains 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
iVBORw0KGgoAAAANSUhEUgAABX8AAAMPCAMAAAC6/lY/AAADAFBMVEXZ2tHf3NV0US9snqPU4t9Zf3lTiYuzycPs7OP///9alZBdf3jJyciSjIT6+Hy2ycNUjIxSoAhUpQZZfnf+/v7B08O2y8WXsathgHhYqgXzyaxcsAfa29R4gXeDb0NhlJC0x8JTjIqyyMLNzspvf3gGCQjM4MeB8imyycU6TXC5zMdPc3C8z8KG8jDe3tZogHdZi4qZp6jb2dHW1s9kfnba0cjR0syu4t1gtwW93euP8TtWe3eR8ks0W1re3NOe8WvR4d2g8XMSKSlTeHNKcW9rzAns7uuh8VaQzyW8z8vZ29AVMTEYODih8mKdtrBlwQdYkI9ckIxhjYvA0s7w8vGFyyBXqQ2vv71biIcpKSOC8TkNICDj5eGtqKBomJSC8Un6/PuT71lAQD2c2Cp+eHrO3tpok5Dn6eYjSEik4DOv5jnE1tJxmpex81yu80cqMi+IWyam7n0gQEEMFBPJ2tZBSklOdnVktxAZPD4zRkSmt7Nx1wyxxL+79GcwOzo9a2lvvBN7d3AeHBc3X1+ovbkoUFFWV1NCbGz3+/Th4ttfYFpWioeg8kBmZ2NHVFOiopxRX161trKgrq16xBo6NyzU96BBZGSToJ+AcEtvc3BuzySCkI5/hoV53ic1UVCqrKlVhIJbaGaM1hJRfHz0/eWt6otkcXCKmZhQUEladnLY+LOj5kjr/Na+809eTEiU82dmwCHi+sQuHRCZmpW355m+v7ldsRaE81rX3c2v82qT5SNhhYRbgIBLRj5wVTqw9YSK4FGLiYC+9HZ75xHT38uTrqiw5lN1goFDXFx93T7B56hNammO2DfL9pHAxcOOkI3S4MVoiYh3zjzB84VwkI3V19ZdSzJwbWXO477I5rTxzbSAclRSPyLc3t2f1EfG08w8TGi99ZrLyMA+LRWJgHW5vJtvZEt9zRGMxUx4wCe53nD5+YrP9oTG9WuZ3WSUl4xvujzDp5Vg |
This file contains 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 requests | |
""" | |
other possible urls: | |
api.binance.com | |
api1.binance.com | |
api2.binance.com | |
""" | |
API_URL = 'https://api3.binance.com/api/v3/avgPrice' |
This file contains 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 random | |
NUMBER_OF_TESTCASES = 100 | |
LETTERS = [chr(i) for i in range(97, 97+26)] # all letters from 'a' to 'z' | |
def random_string_generator(): | |
string_blocks = random.randint(1, 100) | |
string = '' |
This file contains 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 | |
class NewItem: | |
def __init__(self, analysis_date, keyword, current_cpc_max, previous_cpc_max): | |
self.analysis_date = analysis_date | |
self.keyword = keyword | |
self.current_cpc_max = current_cpc_max | |
self.previous_cpc_max = previous_cpc_max |
This file contains 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 copy | |
class Human: | |
def __init__(self, name, birthday, gender): | |
self.name = name | |
self.birthday = birthday | |
self.gender = gender | |
def __repr__(self): |
This file contains 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 = [1, [2, 2, 2], 4] | |
def flat_list(x): | |
return iter(x) | |
def make_iter(data): | |
for i in range(len(data)): | |
if type(data[i]) == list: | |
data[i] = make_iter(data[i]) |
This file contains 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 Army: | |
def __init__(self, units=[]): | |
self.units = [] | |
def add_unit(self, unit_type, amount): | |
self.units = [unit_type() for i in range(amount)] | |
class Warrior: | |
def __init__(self): | |
self.health = 50 |
This file contains 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
AIRPLANE_SPEED = 900 # km/h | |
TRAIN_SPEED = 120 # km/h | |
CAR_SPEED = 100 # km/h | |
ONE_MILE = 1.609344 # km | |
AIRPLANE_PRICE = 100 # per 1h | |
TRAIN_PRICE = 1 # per 1h | |
CAR_PRICE = 1.5 # per 1h | |
class Transport(object): | |
def travel(self, distance, money): |
This file contains 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
AIRPLANE_SPEED = 900 # km/h | |
TRAIN_SPEED = 120 # km/h | |
CAR_SPEED = 100 # km/h | |
ONE_MILE = 1.609344 # km | |
AIRPLANE_PRICE = 100 # per 1h | |
TRAIN_PRICE = 1 # per 1h | |
CAR_PRICE = 1.5 # per 1h | |
class Transport(object): | |
def travel(self, distance, money): |