実行コマンド
#!/usr/bin/python
# -*- coding: utf-8 -*-
import pprint
LIST = ["りんご"]
print("パターン1")
pprint.pprint(LIST)
LIST = {'name': "りんご"}
print("パターン2")
pprint.pprint(LIST)
LIST = ["りんご", "ぶどう"]
print("パターン3")
pprint.pprint(LIST)
LIST = [{'name': "りんご"}, {'name': "ぶどう"}]
print("パターン4")
pprint.pprint(LIST)
LIST = [{'name': "りんご", 'santi': ["青森", "秋田"]}, {'name': "ぶどう", 'santi': ["山梨", "静岡"]}]
print("パターン5")
pprint.pprint(LIST)
LIST = [{'name': "りんご", 'santi': [{'ken': "青森", 'nedan': "120"}, {'ken': "秋田", 'nedan': "200"}]},
{'name': "ぶどう", 'santi': [{'ken': "山梨", 'nedan': "120"}, {'ken': "静岡", 'nedan': "200"}]}]
print("パターン6")
pprint.pprint(LIST)
LIST = [{'name': "りんご", 'santi':
[{'ken': "青森", 'nedan': "120", 'hatubaibi': ["2012/11/1", "2013/11/1"]},
{'ken': "秋田", 'nedan': "200", 'hatubaibi': ["2012/11/1", "2013/11/1", "2014/11/1"]}]},
{'name': "ぶどう", 'santi':
[{'ken': "山梨", 'nedan': "120", 'hatubaibi': ["2012/11/1", "2013/11/1"]},
{'ken': "静岡", 'nedan': "200", 'hatubaibi': ["2012/11/1"]}]}]
print("パターン7")
pprint.pprint(LIST)
コメント