我想在模板中显示女子联赛,这是我的views.py代码:
leagues = League.objects.all()
for league in leagues:
print(league.name)
它将向我显示所有联赛的名称:
International Conference of Amateur Ice Hockey
International Collegiate Baseball Conference
Atlantic Federation of Amateur Baseball Players
Atlantic Federation of Basketball Athletics
Atlantic Soccer Conference
International Association of Womens' Basketball Players
American Conference of Amateur Football
Atlantic Amateur Field Hockey League
Transamerican Womens' Football Athletics Conference
Pacific Ice Hockey Conference
我如何循环遍历这些名称并挑选出包含女子联赛的联赛?
达令说
冉冉说
xcode7.1中,for in 循环遍历字符串提示错误是怎么回事
字符串,遍历,循环变量的取值
C#字符串变量名在for循环中
python中如何用reduce和map把字符串转为数字
相关分类