import json
dict01={"apple":100,"banana":50,"cherry":20}
list01=["apple","banana","cherry"]
tuple01=("apple","banana","cherry")
print("dict01的資料型態是{}".format(type(dict01)))
print(type(list01))
print(type(tuple01))
jasn01=json.dumps(dict01)
jasn02=json.dumps(list01)
jasn03=json.dumps(tuple01)
print("jasn01的資料型態是{}".format(type(jasn01)))
print(type(jasn02))
print(type(jasn03))
print("jasn01的資料是{}".format(jasn01))
print("jasn02的資料是{}".format(jasn02))
print("jasn03的資料是{}".format(jasn03))
2020年12月8日 星期二
python about json (一)
訂閱:
張貼留言 (Atom)
二維陣列(2d array) matrix
import numpy as np fru_items=[["apple","banana","cherry","durian","eggplant","fig...
-
sympy 用於線性代數 from sympy import * a,b,c=symbols("x,y,z") print(a.name) formu=a+a+b+c print(type(a.name)) print(formu) 結果是 x ...
-
import numpy as np fru_items=[["apple","banana","cherry","durian","eggplant","fig...
-
import math def is_prime(n): if n
沒有留言:
張貼留言