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
#!/usr/bin/python | |
# Upbit.org API expample | |
# Full documentation: https://upbit.org/trade/user/apidoc | |
# Key and Secret get here: https://upbit.org/trade/user/api/ | |
key = '<your key>' | |
secret = '<your secret>' | |
import json | |
import time |
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 pool(array): | |
voda = 0 | |
while sum(array): | |
str_row = ''.join(['1' if x else '0' for x in array]) | |
array = [x-1 if x > 1 else 0 for x in array] | |
str_row = str_row[str_row.find('1'):str_row.rfind('1')] | |
cur_voda = str_row.count('0') | |
voda += cur_voda | |
return voda |