We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Introduction
- Python: Division
- Discussions
Python: Division
Python: Division
Sort by
recency
|
1026 Discussions
|
Please Login in order to post a comment
print(a//b) print(float(a/b))
In Python 3, the / operator returns float division while // gives integer division. For example, 5 / 2 is 2.5, but 5 // 2 is 2. It’s a small difference but very important in solving problems correctly. Paying attention to such details is like handling a good bathroom remodeling arvada project precision makes all the difference.
if name == 'main': a = int(input()) b = int(input()) print((a//b)) print((a/b))
this is a informative post
Thanks to sharing