30-Days-Of-Python icon indicating copy to clipboard operation
30-Days-Of-Python copied to clipboard

Issue in Example:Integers on Day:03 Operators

Open BaskarTV opened this issue 10 months ago • 1 comments

Arithmetic Operations in Python

Integers

print('Addition: ', 1 + 2) # 3 print('Subtraction: ', 2 - 1) # 1 print('Multiplication: ', 2 * 3) # 6 print ('Division: ', 4 / 2) # 2.0 Division in Python gives floating number print('Division: ', 6 / 2) # 3.0
print('Division: ', 7 / 2) # 3.5 print('Division without the remainder: ', 7 // 2) # 3, gives without the floating number or without the remaining print ('Division without the remainder: ',7 // 3) # 2 print('Modulus: ', 3 % 2) # 1, Gives the remainder print('Exponentiation: ', 2 ** 3) # 9 it means 2 * 2 * 2

Issue in the comment the output of 2 ** 3 is 8, not 9. The comment in the code is incorrect,

BaskarTV avatar Jan 12 '25 18:01 BaskarTV

Created a pull request for the fix of this issue #643.

AnnieJohnson25 avatar Jan 21 '25 21:01 AnnieJohnson25