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 ...
随机推荐
- npm升级报错,没有权限.ERRERR!The operation was rejected by your operating system. npm ERR!Error: EPERM: operation not permitted, rename
问题描述 Windows system32>npm installg npm 2335 error code EEXIST2336 error path D:\Program Files\nod ...
- elementUI中table组件前端自己实现序号排序
<el-table-column type="index" label="序号" width="50" align="cen ...
- 10个.NetCore实用的开源框架项目
今天我们一起梳理下10个,比较受到大家欢迎的.NetCore开源框架项目.1.FytSoaCms 前后端分离CMS系统 项目简介 这是一个基于.Net 3构建的简单.跨平台.模块化建站系统.系统业务简 ...
- 【虚拟机】虚拟机安装win10
VMware-workstation 16 pro 点击查看代码 密钥: ZF3R0-FHED2-M80TY-8QYGC-NPKYF YF390-0HF8P-M81RQ-2DXQE-M2UT6 ZF7 ...
- REMOTE HOST IDENTIFICATION HAS CHANGED!服务器重置后远程连接不上
问题: 解决: 本地打开shell,重置key
- 为什么 A 能 ping 通 B,B 却不能 ping 通 A ?
有开发小哥咨询了一个问题,记录一下处理过程分享给有需要的朋友. 问题如下: A.B 两台开发服务器连接交换机,并且 A.B 两台服务器的 IP 地址设置为同一个网段,却发现 A 能 ping 通 B ...
- jupyter notebook相关笔记
导出pdf时隐藏代码 参考:https://segmentfault.com/q/1010000043309446
- 手把手XTTS_V4迁移
最近公司Oracle升级,考虑到停机时间等综合因数,最终选择了xtts数据迁移方案. 为此我整理了一份操作手册,方便以后查阅. 关于xtts的介绍可以参见这篇文章: <XTTS,又一个值得你重视 ...
- 03 Proxmox VE介绍
突破困境! 企业开源虚拟化管理平台 使用Proxmox Virtual Environment 郑郁霖(Jason Cheng)著 版次:2021年12月初版 03 Proxmox VE介绍 3.1 ...
- Xpath 常用语法展示
非标准代码处理 from lxml import etree #导入lxml 中erree模块 parser = etree.HTMLParser(encoding="utf-8" ...

