Python历史事件

  • 1989 年 ——— 荷兰人吉多·范罗苏姆决心开发一个新的脚本解释程序;
  • 1991 年 ——— 第一个用C语言实现的Python编译器诞生,Python 的代码对外公布,版本为 0.9.0;
  • 1994 年 ——— Python 1.0诞生;
  • 2000 年 ——— Python 2.0 发布;
  • 2001 年 ——— Python 2.1 基于 Python 软件基金会协议(Python Software Foundation (PSF))发布;
  • 2004年  ——— WEB框架 Django 诞生;
  • 2008 年 ——— Python 3.0 正式发布,Python 3 被称为 "Python 3000" 或者 "Py3K" 。
  • 2014年  ——— 官方宣布版本2将停止更新
  • 2020年  ———2.7版本停止使用

Python用处(简写)

  web应用开发
  自动化运维
  网络爬虫
  数据分析
  科学计算
  人工智能
  网络攻防*的第一语言

Python内容

python代码书写要求

        PEP 8 - Python代码样式指南

https://legacy.python.org/dev/peps/pep-0008/#a-foolish-consistency-is-the-hobgoblin-of-little-minds

  注释

      单行注释-以#和空格开头

  # 这是我的第一个代码
  print('hello world')

      多行注释-使用三个”“进行包括,代码前后引号需要方向一致

"""
# 这是我的第一个代码
print('hello world')
"""

      使用input进行输入

sr1 = input()

      使用print进行输出 1.0

sr1 = input()
sr2 = input()
bl1 = float(sr1)
bl2 = float(sr2)
jg = bl1 + bl2
print(jg)

      使用print进行输出 2.0

name = input()
print(name,'{}'.format('真帅'))

      使用print进行输出 3.0

        使用end进行结果横向输出;

        使用chr将证书转换成该编码对应的字符串(一个字符);

        使用ord将字符串(一个字符)转换成对应的编码(整数);

email = input('输入你的Email:')
for i in email :
res = ord(i)+4
print(chr(res),end="")

       进行简单的类型转化

hswd = input()
ssd = float(hswd)
print(ssd*1.8+32)

      求圆的面积

sr=input()
bj=float(sr)
print(bj*3.14*bj)
print(2*3.14*bj)

      判断闰年

year=int(input())
if (year % 4 ==0 and year % 100 !=0 ) or (year % 400 == 0):
print("true")
else:
print("flase")

      简单的输出一个方框

for i in range(10):
print('#',end="")
print()
for k in range(8):
print('#',' '*8,'#',sep="")
for j in range(10):
print('#',end="")

      求水仙花数

number=input('输入一个数')
if len(number)>3:
print ('The number is to big!')
else:
bai = int(number[0])
shi = int(number[1])
ge = int(number[2])
if bai ** 3 + shi ** 3+ ge ** 3 ==int(number):
print ('水仙花数')
else:
print ('不是水仙花数')

Study python_01的更多相关文章

  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. docker 搭建 nginxconfig.io 文档

    docker镜像仓库 https://hub.docker.com/r/devopstestlab/nginxconfig.io 获取镜像 docekr pull devopstestlab/ngin ...

  2. IO学习笔记7

    2.4 多路复用javaAPI 在上面我们简单java代码实现了多路复用,是一个单线程版的.讲上面的epoll代码复制到linux服务器中,使用strace追踪系统调用. javaAPI会根据系统类型 ...

  3. 【FPGA & Verilog】手把手教你实现一个DDS信号发生器

    信号发⽣器的设计与实现 1.输出波形:⽅波(占空⽐50%).锯⻮波.三⻆波.脉冲信号(占空⽐连续可调).正弦波.任意波等 2.输出频率:100KHz 3.波形选择:使⽤拨码开关选择   思路: 使用F ...

  4. GIT迁移仓库地址时如何保留分支和历史记录

    需求背景 GIT仓库(GitLab)所在服务器因某些原因要关停,相关服务需转移到另外一台机器上. 操作步骤 # clone项目 git clone --mirror http://192.168.12 ...

  5. Hyperledger fabric 续篇

    前面我们如果进行顺利的话,环境已经可以成功运行,并且前端页面也可以正常显示,为自己鼓掌吧!!! 接下来,其实也是我自己想做一下尝试,还记得前面的一条查询车辆情况的指令吗? peer chaincode ...

  6. 关于pytorch一些基础知识的备份

    压缩conda环境用于备份目的实际上没有意义,因为还有其他方法可以做到这一点,这可能更合适,并使用专为此而设计的内置功能. 您可以创建一个环境.txt版本conda,详细说明其中的每个模块和版本,然后 ...

  7. fatal error: openssl/ssl.h: No such file or director

    $ sudo apt-get install libssl-dev

  8. CSS之小知识

    1.居中 a.文字水平居中 text-align:center; b.文字垂直居中 /* 如果有n行文字,那么将行高设为容器高度的n分之一 */ height: 35px; line-height: ...

  9. Lecture 2. Fundamental Concepts and ISA - Carnegie Mellon - Computer Architecture 2015 - Onur Mutlu

    并不只有冯诺依曼模型,按照控制流顺序执行指令 还有 data flow 模型,按照数据流顺序执行指令 冯诺依曼模型和数据流模型的编程语言的一个对比 Control-driven 编程模型和 data- ...

  10. CF652F 题解

    题意 传送门 在一个长度为 \(m\) 的圆环上有 \(n\) 只初始位置互不相同的蚂蚁,每只蚂蚁的速度都为 \(1\),初始方向为顺时针或逆时针:两只运动方向不同的蚂蚁相遇时会调转方向,问 \(t\ ...