Unlike C, in Python arithmetic operation involving only integers do not always return an integer. If you want a truncated integer returned from a integer division, use // instead of /.
Lets see the examples:
a = 3;
b = 1;
x = a/b;
print(type(a), " / ", type(b), " produce ", type(x));
a = 3.0;
b = 1.0;
x = a/b;
print(type(a), " / ", type(b), " produce ", type(x));
a = 3;
b = 1;
x = a//b;
print(type(a), " // ", type(b), " produce ", type(x));
a = 3.0;
b = 1.0;
x = a//b;
print(type(a), " // ", type(b), " produce ", type(x));
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhla3UyQNb3WtX1CdtwwQUK8J6vF8jbfme9-91cyFMxEaE-Z9dRtLoVuqr5SV0xF7UFfa5kFwQ6QzL7TQOIqDi_Sqyvffbuh4TjUaucJYQj4v8G_nWH9_x_Zn97rAybOYVOZcRIMP7W-jI/s400/int.png)