Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> def square(x):
- ... runningtotal = 0
- ... for counter in range(x):
- ... runningtotal = runningtotal + x
- ... return runningtotal
- ...
- >>> toSquare = 10
- >>> squareResult = square(toSquare)
- >>> squareResult
- 10
- >>> square(toSquare)
- 10
- >>> square(2)
- 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement