函数

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

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. 电脑安装不同版本的QT

    系统:windows Qt版本:5.10/5.13 电脑中已经安装5.10版本的,安装5.13版本的不知道是否会出现问题,故此记录. 下载安装Qt5.13,安装过程跟之前版本的基本没差别,安装路径 D ...

  2. 加密算法和hash

    随着安全问题越来越被重视,公司也全面替换了HTTP为HTTPS.2015年iOS9的ATS到今年苹果更是放出话来,2017年全面支持HTTPS,不支持的App,在审核的时候可能会遇到麻烦.鉴于此,我有 ...

  3. Codeforces Global Round 17

    Codeforces Global Round 17 A. Anti Light's Cell Guessing 坑点:\(n=1,m=1\) 时答案为 \(0\) . 其他情况:当 \(n=1\) ...

  4. lombok安装不了的问题

  5. 记录 springboot 整合swagger2 出现documentationPluginsBootstrapper&&NullPointerException异常

    记录 由于springboot版本高 整合swagger2出现null异常 springboot 版本: swagger2 依赖版本: 出现的异常: 解决方案: application 添加如下依赖 ...

  6. springmvc的Interceptor拦截器和servlet的filter过滤器

    springmvc的Interceptor拦截器和servlet的filter过滤器 1.springmvc的Interceptor拦截器和servlet的filter过滤器springboot实现方 ...

  7. go开发框架推荐

    根据自己了解的情况,从易用性和文档完善程度来说,推荐优先考虑使用如下框架: fiber revel echo iris gin beego 以revel作为入门教程,在go项目的根文件夹里执行下面2条 ...

  8. java基础(一)~~内存分析

    1.java内存分析 2.2.面向对象内存分析 Java虚拟机的内存可以分为三个区域:栈(stack).堆(heap).方法区(method area): 2.2.1.栈 栈的特点如下: 1.栈描述的 ...

  9. IQuerable展示数据时出现重复【View在类定义的时候没有将多主键给标识出来】

    废话少说,直接上图! 从上面可以看到我有一些数据是重复了,是整条记录都重复了,但是我看到数据库里面的View数据是没有重复的,那就说明问题:"可能是View在类定义的时候没有将多主键给标识出 ...

  10. C# VS2019修改工程名

    1.修改解决方案的名称:选择解决方案的名称,右键重命名即可 2.修改项目名称,方法同上,不再赘述 3.修改项目的程序集名称和默认命名空间:选择项目,右键属性,弹出如下对话框 4.替换项目或解决方案中的 ...