What does "//" do to Python?

Asked 2 years ago, Updated 2 years ago, 18 views

y = img_index // num_images

I saw a code like this, and if it was C, it would be annotated, but I don't know what // is doing on Python.

python

2022-09-22 14:29

1 Answers

In python3

in python2

>>> 3/5
0
>>> 3//5
0
>>>
>>> 3/5
0.6
>>> 3//5
0
>>> 


2022-09-22 14:29

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.