Python3高级基础(1)
[TOC] Introducing Python Object Types Built-in objects make programs easy to write Built-in objects are components of extensions Built-in objects are often more efficient than custom data structures Built-in objects are a standard part of the language 123 + 222 #整数的加法 345 1.5 * 4 #浮点型的乘法 6.0 2 ** 100 # 2的100次幂 1267650600228229401496703205376 len ( str ( 2 ** 100 )) 31 3.1415 * 2 6.283 import math # 导入数学模块 print ( '$\pi$的数值是:{}' . format ( math . pi )) print ( '85的开方是:{}' . format ( math . sqrt ( 85 ))) $\pi$ 的数值是: 3.141592653589793 85 的开方是: 9.219544457292887 import random random . random () 0