函数

基本思想---函数是用来重复使用的

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的更多相关文章

  1. 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 ...

  2. RSA Study

    These days I study the RSA Algorithm. It is a little complex, but not very. Also, my study has not f ...

  3. Machine Learning Algorithms Study Notes(3)--Learning Theory

    Machine Learning Algorithms Study Notes 高雪松 @雪松Cedro Microsoft MVP 本系列文章是Andrew Ng 在斯坦福的机器学习课程 CS 22 ...

  4. Machine Learning Algorithms Study Notes(2)--Supervised Learning

    Machine Learning Algorithms Study Notes 高雪松 @雪松Cedro Microsoft MVP 本系列文章是Andrew Ng 在斯坦福的机器学习课程 CS 22 ...

  5. Machine Learning Algorithms Study Notes(1)--Introduction

    Machine Learning Algorithms Study Notes 高雪松 @雪松Cedro Microsoft MVP 目 录 1    Introduction    1 1.1    ...

  6. 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 ...

  7. 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 ...

  8. A Study of WebRTC Security

    转自:http://webrtc-security.github.io/ A Study of WebRTC Security Abstract Web Real-Time Communication ...

  9. study topics

    永远不变的东西,原理 study roadmap: 1.user space: tizen power manager => suspend/resume or runtime? android ...

  10. 读书笔记2013第10本:《学得少却考得好Learn More Study Less》

    <学得少却考得好Learn More Study Less>这本书最早是从褪墨网站上看到的,crowncheng翻译了全文.这本书介绍了不少学习方法,非常适合在校的学生,原文的作者Scot ...

随机推荐

  1. Java笔记_构造方法/构造器

    构造方法/构造器(constructor)   怎么来的?之前在创建对象时,是先把一个对象创建好后,再给这个对象的属性赋值,如果现在要求在创建一个对象时,就直接指定这个对象的属性,该怎么做?此时就可以 ...

  2. Blog-3

    前言 这几周的作业所涉及的知识点有数据的封装和.继承与多态.正则表达式,还有抽象类和接口,另外还有javafx的一些基本知识.题量适中,但是难度对于我来说是比较大的.总的来说就是跟以前的题目差不多,只 ...

  3. 外卖小项目(SpringBook)

    一.创建项目,配置maven 二.写配置文件application.yml 三.编写项目启动类 四.设置静态资源路径 基础环境搭建完毕

  4. 合格できる日本語能力試験, N1.PDF

    书本详情 合格できる日本語能力試験, N1种类:Languages - Japanese Language Reference年:2010出版:Shohan.出版社:Aruku语言:japanese页 ...

  5. cocos2d-lua 控制台输入Lua指令方便调试

    用脚本进行开发,如果不能实时去输入指令,就丧失了脚本的一大特色,所以对cocos2d-x程序稍微修改下,使其可以直接从控制台读入lua指令,方便调试. 1 首先在行首加入lua的引用,如下 1 #in ...

  6. return chain.filter(exchange); 这句啥意思

    答:继续往后执行过滤器,如果不调用这句代码,请求就不会发给控制器了,如果当前执行的过滤器后面还有过滤器,执行那个过滤器,如果没有,就执行控制器. 那我此时想一个请求取消token校验,得在这里加吗? ...

  7. Ubuntu20.04安装PEA软件

    PEA软件可用于实时精密卫星钟差估计,精密卫星定轨,精密单点定位,电离层建模以及DCB估计等. Ginan开发人员推荐使用Ubuntu18.04或Ubuntu20.04搭建,本文使用Ubuntu20. ...

  8. VS2019使用gtest

    VS2019使用gtest GoogleTest测试框架介绍(一)_liitdar的博客-CSDN博客_goole test 术语 test/test case/test suit Meaning G ...

  9. Systrace学习记录

    「置顶」Android 性能优化必知必会[大量文章] https://androidperformance.com/2018/05/07/Android-performance-optimizatio ...

  10. 230222 Radiated Immunity Pre-compliance Test

    Hello everyone, welcome to Mach1 Design EMC channel. Last time we talked about how to set up a radia ...