Skip to content

Commit 1f45822

Browse files
committed
Fix double_bug function to multiply by 2 instead of 3
1 parent 5bb7641 commit 1f45822

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

prep-exercises/why_we_use_types.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ def second(value):
2222
print(second("hello"))
2323
print(second("22"))
2424

25-
# The bug: this function is called double but multiplies by 3!
2625
def double_bug(number):
27-
return number * 3
26+
return number * 2
2827

29-
print(double_bug(10)) # Should return 20 but returns 30
28+
print(double_bug(10)) # Returns 20 (correctly doubles the number)

0 commit comments

Comments
 (0)