Python中的可迭代对象有:列表.元组.字典.字符串:常结合for循环使用: 判断一个对象是不是可迭代对象: from collections import Iterable isinstance(list(range(100)), Iterable) isinstance('Say YOLO Again.') 列表: L = list(range(100)) for i in L: print(i) 元组: T = tuple(range(100)) for i in T: print(
在返回json对象的几种方式: 1 from django.shortcuts import render, HttpResponse # Create your views here. from django.views import View from app01 import models import json class BookListView(View): """使用json进行json序列化""" def get(self, re