Skip to content

Instantly share code, notes, and snippets.

@Yotamho
Last active December 19, 2020 11:01
Show Gist options
  • Select an option

  • Save Yotamho/15290fb1b49c5cd89a8b7b0f0e5aab0f to your computer and use it in GitHub Desktop.

Select an option

Save Yotamho/15290fb1b49c5cd89a8b7b0f0e5aab0f to your computer and use it in GitHub Desktop.
def int_to_string(ls, n, i = 0):
if n == 0:
ls[i] = '\0'
return 0
else:
idx = int_to_string(ls, n // 10, i+1)
ls[idx] = str(n % 10)
return idx + 1
ls = [''] * 100
int_to_string(ls, 1234567)
print(ls)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment