(xnumber, xbase, arr, ybase)
| 40 | |
| 41 | |
| 42 | def convert_to_10(xnumber, xbase, arr, ybase): |
| 43 | if int(xbase) == 10: |
| 44 | for char in xnumber: |
| 45 | arr.append(char) |
| 46 | flipped = arr[::-1] |
| 47 | ans = 0 |
| 48 | j = 0 |
| 49 | |
| 50 | for i in flipped: |
| 51 | ans = ans + (int(i) * (int(ybase) ** j)) |
| 52 | j = j + 1 |
| 53 | return ans |
| 54 | |
| 55 | |
| 56 | arrayfrom = [] |
no test coverage detected