Introduction to python: division or multiplication in py2.x can be written in this way to calculate the result after the decimal point

1  # !/usr/bin/env python 
2  # -*- coding:utf-8 -*- 
3   # The division or multiplication in py2.x can be written in this way to calculate the result after the decimal point, which is more accurate future (future, transliteration: non- worry car) division (division, transliteration: 德 for god) 
4   # Ctrl+/ shortcut key for comment 
5  from  __future__  import division
 6 x = 9 /2
 7  print (x)

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324507780&siteId=291194637