How to force division to return the int part in Python

1 Answer

0 votes
result = 21 // 6

print(result) 

print(type(result))

print(21 / 6)
 
 
 
 
 
'''
run:
 
3
<class 'int'>
3.5

'''

 



answered Jul 17, 2022 by avibootz
...