Study python_03
函数
基本思想---函数是用来重复使用的
def shili(input_):
print("我了个去 %s"%input_)
shili('你竟然')
当一个函数中即有默认参数,
又有变量参数时,
需要将默认参数放在最后面
def shili(a, b = 1):
print(a,b)
shili(99)
简单使用函数求
1/3+3/5+5/7+...+n/n+2
def xx(res):
for i in range(1,98,2):
res += i/ (i+2)
print(res)
xx(0)
简单的匹配手机号
使用正则表达式
import re
compile_ =re.compile('^1[3456789]\d{9}')# 正则表达式
res = compile_.findall('15088888888')
print(res)# 成功输出手机号,不成功输出空
简单的倒数读秒
import time
for seconds in range(10,0,-1):
time.sleep(1)
print('%d秒'%seconds)
Study python_03的更多相关文章
- Improve Your Study Habits
1.Plan your time carefully. Make a list of your weekly tasks.Then make a schedule or chart of your t ...
- RSA Study
These days I study the RSA Algorithm. It is a little complex, but not very. Also, my study has not f ...
- Machine Learning Algorithms Study Notes(3)--Learning Theory
Machine Learning Algorithms Study Notes 高雪松 @雪松Cedro Microsoft MVP 本系列文章是Andrew Ng 在斯坦福的机器学习课程 CS 22 ...
- Machine Learning Algorithms Study Notes(2)--Supervised Learning
Machine Learning Algorithms Study Notes 高雪松 @雪松Cedro Microsoft MVP 本系列文章是Andrew Ng 在斯坦福的机器学习课程 CS 22 ...
- Machine Learning Algorithms Study Notes(1)--Introduction
Machine Learning Algorithms Study Notes 高雪松 @雪松Cedro Microsoft MVP 目 录 1 Introduction 1 1.1 ...
- jar tvf study.war jar命令查看war/jar包的内容
jar tvf study.war 0 Thu Oct 20 14:01:18 CST 2016 META-INF/ 137 Thu Oct 20 14:01:16 CST 2016 META-INF ...
- Mongo DB Study: first face with mongo DB
Mongo DB Study: first face with mongo DB 1. study methods: 1. Translate: I am the mongo DB organiz ...
- A Study of WebRTC Security
转自:http://webrtc-security.github.io/ A Study of WebRTC Security Abstract Web Real-Time Communication ...
- study topics
永远不变的东西,原理 study roadmap: 1.user space: tizen power manager => suspend/resume or runtime? android ...
- 读书笔记2013第10本:《学得少却考得好Learn More Study Less》
<学得少却考得好Learn More Study Less>这本书最早是从褪墨网站上看到的,crowncheng翻译了全文.这本书介绍了不少学习方法,非常适合在校的学生,原文的作者Scot ...
随机推荐
- 面试:关于Zookeeper注册节点的上线和掉线
Zookeeper中有一个重要的部件Monitor(监控中心),它是Dubbo中服务治理体系中的重要一环. 监控中心在启动的时候,会通过Zookeeper的/dubbo/com.foo.BarServ ...
- myod od -tx -tc功能的c语言实现1210
一.实验要求 1. 复习c文件处理内容: 2. 编写myod.c 用myod XXX实现Linux下od -tx -tc XXX的功能: 3. main与其他分开,制作静态库和动态库: 4. 编写Ma ...
- pr导出mp4格式提示无法播放解决方案
pr导出mp4格式提示无法播放解决方案 1.这里的mp4格式就是导出的H.264格式 2. 这里选择导出,默认选项,导出视频有时候出现无法播放现象 3.另外,在视频右击的详细信息中没有任何数据 ...
- Winform窗体中打开PDF文件的三种方式
来源:https://www.jb51.net/article/251451.htm
- CH583 是集成 BLE 无线通讯的 RISC-V MCU 微控制器
CH583 是集成 BLE 无线通讯的 RISC-V MCU 微控制器.片上集成 2Mbps 低功耗蓝牙 BLE 通讯模块.2 个全速 USB 主机和设备控制器及收发器.2 个 SPI.4 个串口.1 ...
- usb 2.0 packet
注意PID[7:0] = {~pid[3:0], pid[3:0]}
- mysql企业常用集群架构
转自 https://blog.csdn.net/kingice1014/article/details/76020061 1.mysql企业常用集群架构 在中小型互联网的企业中.mysql的集群一般 ...
- wpf DataGrid相关总结
1.去掉外边蓝框,设置BorderThickness="0"
- ubuntu20.04系统中扩展swap分区
1.首先停止/swapfile #swapon /swapfile 2.删除以前的/swapfile #rm -rf swapfile 3.创建新的/swapfile(以2G为例) #dd if=/d ...
- centos7的密码安全策略加固
centos7操作系统 在CentOS 7上实现密码复杂度策略设置 一.使用login.defs文件 解析:/etc/login.defs 是设置新建用户帐号限制的文件.该文件里的配置对root用户无 ...

