Skip to content

Instantly share code, notes, and snippets.

@jaredhowland
Created September 23, 2025 20:15
Show Gist options
  • Select an option

  • Save jaredhowland/a479c89245a8754e14a504515634edfc to your computer and use it in GitHub Desktop.

Select an option

Save jaredhowland/a479c89245a8754e14a504515634edfc to your computer and use it in GitHub Desktop.
def digit_count(num, count = 0):
if num < 10:
count += 1
return count
else:
count += 1
num = str(num)
num = num[1:]
num = int(num)
digit_count(num, count)
if __name__ == '__main__':
num = int(348)
digit = digit_count(num)
print(digit)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment