(一)内置函数的简单使用
Using the Python type() function
type() returns the data type of python objects
str, int, float
What does using type() reveal?
-
str: when type() returns str that means it has evaluated a string characters (numbers, letters, punctuation...) in quotes -
int: when type() returns int that means it has evaluated an Integer (+/- whole numbers) -
float: when type() returnsfloatthat means it has evaluated decimal numbers (e.g. 3.33, 0.01, 9.9999 and 3.0), ...more later in the course
示例图:
(a)
(b)
(c)
翻译: display:显示