Оцените сложность функций (алгоритмов) 1)
def to10(nums, base):
nomer = len(nums)-1
num = list(nums)
hex_nums = {"a":10, "b":11, "c":12, "d":13, "e":14, "f":15}
res = 0
index = 0
for i in range(len(nums)):
try:
int(num[i])
except:
num[i] = hex_nums.get(num[i])
for i in range(len(nums)):
res = res + base**index * int(num[nomer])
nomer-= 1
index+=1
return res
2)
def toanother(num10, to):
res = ''
hex_nums = {10:"a", 11:"b", 12:"c", 13:"d", 14:"e", 15:"f" }
while num10 > 0:
if int(num10 % to) > 9:
remainder = str(hex_nums.get(int(num10 % to)))
else:
remainder = str(num10 % to)
res = remainder + res
num10 = num10 // to
return res