Adopted new convention from template
This commit is contained in:
parent
6912146be7
commit
3fe956d388
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python
|
||||||
"""
|
"""
|
||||||
Created on 17 Jun 2017
|
Created on 17 Jun 2017
|
||||||
|
|
||||||
@ -25,8 +25,9 @@ def compute():
|
|||||||
natural numbers and the square of the sum is 3025 − 385 = 2640.
|
natural numbers and the square of the sum is 3025 − 385 = 2640.
|
||||||
|
|
||||||
Find the difference between the sum of the squares of the first one
|
Find the difference between the sum of the squares of the first one
|
||||||
hundred natural numbers and the square of the sum. Statement
|
hundred natural numbers and the square of the sum.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
n = 100
|
n = 100
|
||||||
square_of_sum = sum(i for i in range(1, n + 1)) ** 2
|
square_of_sum = sum(i for i in range(1, n + 1)) ** 2
|
||||||
sum_squares = sum(i**2 for i in range(1, n + 1))
|
sum_squares = sum(i**2 for i in range(1, n + 1))
|
||||||
@ -35,5 +36,4 @@ def compute():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
print(f"Result for Problem 6 is {compute()}")
|
||||||
print(f"Result for Problem 6: {compute()}")
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user