Squared Numbers

Run Settings
LanguagePython
Language Version
Run Command
max = 100 def naturalSumSquared (max): numberCount = 0 totalSum = 0 for numberCount in range(max): numberCount += 1 totalSum += numberCount totalSum **= 2 return totalSum def naturalSquaredSum (max): numberCount = 0 totalSum = 0 for numberCount in range(max): numberCount += 1 totalSum += (numberCount**2) return totalSum print(naturalSumSquared(max)) print(naturalSquaredSum(max)) print(naturalSumSquared(max) - naturalSquaredSum(max))
Editor Settings
Theme
Key bindings
Full width
Lines