python濡備綍鑾峰彇鍙橀噺绫诲瀷
鍦≒ython涓紝鍙互浣跨敤type()
鍑芥暟鏉ヨ幏鍙栦竴涓彉閲忕殑绫诲瀷銆傜ず渚嬪涓嬶細
x = 5
print(type(x)) # <class 'int'>
y = 3.14
print(type(y)) # <class 'float'>
z = "Hello"
print(type(z)) # <class 'str'>
type()
鍑芥暟灏嗚繑鍥炲彉閲忕殑绫诲瀷锛屼緥濡?code>int琛ㄧず鏁存暟绫诲瀷锛?code>float琛ㄧず娴偣鏁扮被鍨嬶紝str
琛ㄧず瀛楃涓茬被鍨嬬瓑銆?/p>
相关问答