Skip to content

Commit 37d086b

Browse files
committed
I just learnt this.
1 parent be1eb90 commit 37d086b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

firstAlgorithm.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
def square(tosquare):
2+
running_total = 0
3+
for i in range(tosquare):
4+
running_total += tosquare
5+
6+
return running_total
7+
8+
tosquare = int(input('> '))
9+
result = square(tosquare)
10+
print(f'The square of {tosquare} is {result}')

0 commit comments

Comments
 (0)