I want python to return 0.5 if I write 1/2 (and not 1.0 / 2.0). how to get python to return floating point? (I tried using getcontext (). The decimal form form module)
thank
Ariel
Use this or switch to Python 3.0+
from __future__ import division
Python 3.x .
Python 2.2 from __future__ import division, / . //, - .
. PEP238 - .
Source: https://habr.com/ru/post/1734549/More articles:Unable to update text in UILabel - iphoneMoving Windows Mobile Screen - c #ELF feelings and dynamic linking in ARM linux - linuxLinq to sql "Root level data invalid" error for xml null column - c #How to find the location of two consecutive spaces in a string - c ++Converting a WPF Project to Silverlight - wpfSyntax for using an array of wires as input - arraysjavascript/IE 6/7: проверьте, есть ли внутри iframe - javascriptWhere is the call in std :: map :: operator [] in this code? - c ++Is it possible to move a property to another class using ReSharper? - propertiesAll Articles