Skip to content

Instantly share code, notes, and snippets.

@cwake
Created January 24, 2015 02:57
Show Gist options
  • Save cwake/34e7f80bf0701ed1455f to your computer and use it in GitHub Desktop.
Save cwake/34e7f80bf0701ed1455f to your computer and use it in GitHub Desktop.
Adds all numbers 1 to 100
#1to100
def onetohundred():
sum = 0 ;
for i in range( 1 , 100):
sum= sum + i;
print("Print the sum of all numbers 1 to 100:",sum);
onetohundred()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment