Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f7ba39e

Browse files
Merge pull request #2 from Ahtisham-1214/Fix_Computational_Issue
Fixed a little computational error as it is my first open source contribution
2 parents 159489f + 9ab7be0 commit f7ba39e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎CH05/EX5.26.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# 5.26 (Sum a series) Write a program to sum the following series:
22

33
sum = 0
4-
for i in range(1, 98):
4+
# As there was a computational error because the loop is running in linear,
5+
# indeed it should increment by 2. But still you're a legend because you solved 5 years ago,
6+
# but I'm doing in this modern era where there are so tools like gpt to assure solved problem
7+
for i in range(1, 98, 2):
58
sum += i / (i + 2)
69

710
print("Sum is", sum)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /