Skip to content

Instantly share code, notes, and snippets.

@fernandotakai
Created September 30, 2017 19:58
Show Gist options
  • Save fernandotakai/2ce4aefe81a16efdfcc37c63eaf6369e to your computer and use it in GitHub Desktop.
Save fernandotakai/2ce4aefe81a16efdfcc37c63eaf6369e to your computer and use it in GitHub Desktop.
try:
number = int(input('Enter a number '))
sum = sum(range(1, number + 1))
print(f'sum is {sum}')
except ValueError:
print('Not a number')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment