摘要:
#:/usr/bin/env python # # -*- coding:utf-8 -*- usernames = ['xiaohei','xiaobai','xiaoming'] passwords = ['123456','11111','1'] #print(dict(zip(usernam 阅读全文
摘要:
python类型: Python 类型有:整数(int),小数(float),字符串(string) “ python” 加引号的都为字符串 Python判断 if ,elif: else:(只用这三种判断) eg: age =18 if age>=18: # (:标注这一行结束) print('成 阅读全文
摘要:
循环,迭代,遍历 都指的是循环 python: while 循环必须由结束条件 break:立刻结束循环 continue:结束本次 继续下一次 for ,while循环 while 语句 首先要有一个计数器 count = 0 while count<10: print('学生') count = 阅读全文
摘要:
占位符讲解 +号占位 name = '小王'time = '2020-4-23 10:07:06's = '欢迎'+name,'今天是'+time这样,虽然简单,不推荐,因为内存里存好几个变量 一 %s占位 eg: name = ‘小王’ tiem='2020年4月23日' s1 ='欢迎%s登录, 阅读全文
摘要:
list列表也叫数组 list 用 [ ]表示 如何定义一个列表 stu=[] #空列表 新增 stus.append('xx')增加到最后一个 stus = ['老大','老二','老三'] stus.append('老四') print(stus) stu.insert(0,老四)增加到第一个 阅读全文