摘要:
# coding=utf-8 # 1、有列表['alex',49,[1900,3,18]],分别取出列表中的名字,年龄,出生的年,月,日赋值给不同的变量 # l = ['alex',49,[1900,3,18]] # name = l[0] # print(name) # age = l[1] # 阅读全文
posted @ 2020-03-11 20:46
思江
阅读(202)
评论(0)
推荐(0)
摘要:
一、for循环 for循环:循环就是重复做某件事,for循环是python提供第二种循环机制(第一种是while循环),理论上for循环能做的事情,while循环都可以做。 目的:之所以要有for循环,是因为for循环在循环取值(遍历取值)比while循环更简洁。 二、for循环语法如下 for 变 阅读全文
posted @ 2020-03-11 01:31
思江
阅读(39859)
评论(0)
推荐(0)