Google Code Prettify - 輕量級的語法上色工具

星期四, 3月 14, 2019

Python3 資料結構與使用時機:

# -*- coding: utf-8 -*-
"""
Tuple:資料設定後不能更改。一般用在設定(類似PHP的常數)

List:簡單的資料造訪與計算。一般用在一維資料。可用各式的資料型態。

資料分析使用numpy的array
http://www2.nkfust.edu.tw/~shanhuen/PythonTutorialHtml/NumPy/NumPy1.html

Dictionary:單一關鍵值使用(字典:如 n = { 學生姓名 : [各科成績] ), ....}

Set:不常用。一個無序不重複元素集,可以計算交集、差集、並集等。
Frozenset:不常用。
http://www2.nkfust.edu.tw/~shanhuen/PythonTutorialHtml/_14_set.html

"""
print(__doc__)

print('====== List')
list=[1,2,3.33,True,'a',6]
print (list,'\t', type(list))
for i in list:
    print(type(i),i)