分类
摘要:
17.嵌套循环
# 嵌套循环 nested loop
# 在一个循环中使用另外一个循环
num_list1 = [1, 2, 3, 4]
num_list2 = [6, 7, 8, 9]
# 组合list1和list2
# (1,6) (1,7) (1,8) (1,9)
# 第一次循环 1 , 2 ... 阅读原文
2019-11-19 06:00:13 阅读(2702) 评论(0)
摘要:
官方文档:
https://docs.python.org/2/library/logging.html
logging模块提供了两种记录日志的方式:
第一种方式是使用logging提供的模块级别的函数
第二种方式是使用Logging日志系统的四大组件
其实,logging所提供的模块级别的日志... 阅读原文
2019-11-19 00:45:04 阅读(2437) 评论(0)
摘要:
相信很多小伙伴学python以后都想进大厂,但是进大厂前你得了解些大厂面试题,可以在面试前复习下,以下是精选的5道python面试题:
第一. Python 的特点和优点是什么?
Python 可以作为编程的入门语言,因为他具备以下特质:
解释性
动态特性
面向对象
语... 阅读原文
2019-11-19 00:38:02 阅读(3691) 评论(0)
摘要:
# 图像处理标准库
from PIL import Image
# web测试
from selenium import webdriver
# 鼠标操作
from selenium.webdriver.common.action_chains import ActionChains
# 等待时间 产生随机... 阅读原文
2019-11-19 00:00:02 阅读(2870) 评论(0)
摘要:
少儿编程和数学是有这一定联系的,若是将编程弄好了,数学成绩也就会有所提高,今天就为大家来介绍一下一个关于数学的相关编程,现在我们就来看看吧!
题目描述
编程实现以下功能:查询水果的单价。有4种水果,苹果(编号:1001)、梨(编号:1002)、桔子(编号:1003)和葡萄(编号:1004),单价... 阅读原文
2019-11-18 21:41:04 阅读(2377) 评论(0)
摘要:
testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttest
testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttest
testtesttesttesttesttestt... 阅读原文
2019-11-18 21:34:02 阅读(2380) 评论(0)
摘要:
14.return
# print(1) 可以被执行
def doubelNumber(num):
print(1)
return num * 2
print(2)
Afnum = doubelNumber(100)
print(Afnum)
run结果:
15.whi... 阅读原文
2019-11-18 21:24:03 阅读(2670) 评论(0)
摘要:
12.函数
# 函数 function
# def 声明函数
# 关键字 keywords
# print("Hello ke")
name = "songKE"
# 注意 缩进块 定义 函数 自上而下
def sayHello(name, age):
print("H... 阅读原文
2019-11-18 20:10:03 阅读(2395) 评论(0)
摘要:
10.列表
# 列表 List 同时存放很 多数据
# 正数索引index 0 1 2
# 负数 -3 -2 -1
fruits1 = ["apple", "orange", "pear"]
# 列表支持 数字 字符串 布尔 类型... 阅读原文
2019-11-18 19:47:02 阅读(2345) 评论(0)
摘要:
8.数字函数
# 引入数学库
from math import *
# 字符转换字符串 str()
print(str(7) + "幸运数字") # 字符串 7
mynum = -7
# abs 取绝对值
print(abs(mynum))
# pow 幂函数
print(pow(2, 4)... 阅读原文
2019-11-18 18:15:02 阅读(2650) 评论(0)