+ 3

Doubt

Why print(-15//10.0) output -2.0.

13th Jun 2024, 4:36 AM
You
You - avatar
2 Réponses
+ 5
You The output “-2.0” is because of the way integer division (floor division) in Python, especially when using negative numbers. print(-15//10.0) #output -2.0. print(15//10.0) #output 1.0.
13th Jun 2024, 5:23 AM
BroFar
BroFar - avatar
+ 1
Thanks BroFar
13th Jun 2024, 5:49 AM
You
You - avatar