雷达智富

首页 > 内容 > 程序笔记 > 正文

程序笔记

json python中的转储函数

2024-08-21 27

json python中的转储函数dumps function in json python
import json
 
# Creating a dictionary
Dictionary ={1:'Welcome', 2:'to',
            3:'Geeks', 4:'for',
            5:'Geeks'}
  
# Converts input dictionary into
# string and stores it in json_string
json_string = json.dumps(Dictionary)
print('Equivalent json string of input dictionary:',
      json_string)
print("        ")
 
# Checking type of object
# returned by json.dumps
print(type(json_string))
更新于:26天前
赞一波!5

文章评论

全部评论