How can I force division to be floating point in python?



How can I force division to be floating point in python?..

Answer / Jigyasa Kumari

To force division to always return a float in Python, you can use the `from __future__ import division` directive at the beginning of your script. This ensures that integer division will also produce a float.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

What is the parameter passing mechanism in Python?

1 Answers  


What is the different between range () and xrange () functions in python?

1 Answers  


Which is better python or r?

1 Answers  


Explain lambda expressions. When would you use one?

1 Answers  


What are python slots?

1 Answers  


Is python free or paid?

1 Answers  


What is r regex?

1 Answers  


Is Python a good choice for web development

1 Answers  


What is the purpose of a // operator?

1 Answers  


How is numpy different from scipy?

1 Answers  


What is python with statement?

1 Answers  


Why we are using a python dictionary?

1 Answers  


Categories