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 ...
随机推荐
- sudo:Operation not permitted事件
转载请注明来源:https://www.cnblogs.com/Sherlock-L/p/14933949.html 前言 事情是这样的,在风和日丽的一天,我如往常一样在服务器上敲下了sudo xxx ...
- OS-lab6
OS-lab6 管道 在lab5的时候我们实现了文件类设备的读写操作,而在fd.c中,我们定义了3种设备:文件类设备.管道.终端,其中终端已经被完成了,剩下的就是管道了. 管道是一种父子进程间通信的设 ...
- string中的stoi()函数
1094 谷歌的招聘 (20分) 本题要求你编程解决一个更通用的问题:从任一给定的长度为 L 的数字中,找出最早出现的 K 位连续数字所组成的素数. 输入格式: 输入在第一行给出 2 个正整数,分别是 ...
- vite + vue3 + js + xlsx 导出excel
安装依赖 1 npm install xlsx --save 使用版本 封装js /* 导出excel文件 */ /** * 导出excel文件实现思路分析 * * 1.通过XLSX插件的 XLSX. ...
- 关于github的自动化检测
github 中的 Some checks were not successful什么意思呢? 在 GitHub 上,当您向存储库提交拉取请求时,如果存在自动化的检查(例如CI/CD)或在 pul ...
- (Fiddler)Fiddler 的相关操作
Fiddler 的几个常用操作: 1. Statistics:会话信息统计 1)选择当前页面的第一个请求和最后一个请求,通过计算 statistics,就知道该页面总共的耗时时间. 2)查出当前页面耗 ...
- C++ primer 5th 第一章 开始 阅读笔记
第一章 开始 第一节 编写一个简单的C++程序 不同编译器使用不同的后缀命名约定,比如cc.cpp.c. 比如main程序保存到prog1.cc中,可以使用如下命令来编译它:cc prog1.cc.其 ...
- macOS Big Sur 设置JAVA_HOME
默认JAVA_HOME指向的是: /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home 这个不是我们自己安装的jdk,另外本 ...
- Jmeter - Config Tips
Guideline: Jmeter.properties file should avoid to be modified , modified user.properties instead > ...
- StatefulWidget 有状态组件 、 页面上绑定数据、改变页面数据
一.Flutter 中自定义有状态组件 在 Flutter 中自定义组件其实就是一个类,这个类需要继承 StatelessWidget/StatefulWidget. StatelessWidget ...

