栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

Python打卡第二天

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Python打卡第二天

Note2

  1. 输入一般格式  a=input(“输入:”)/print(“输入的内容是:”,a)
  2. 当进行输入操作时,无论什么情况,其输出格式都为字符型
  3. 当需要把字符串变成数字时,可以强制类型转化,即加一个”int()”
  4. “**”是返回x的y次幂,”//”是向下取接近除数的整数
  5. Python指定任何非0和非空值为True,0或None为False
  6. if后面的语句必须空格
  7. 引入随即库”import random”/随机生成整数”x=random.randint(0,10)”

English version

1.The simple code of “input” is a=input(“input:”)/print(“the comment of input is :”,a)

2.Whenever we need to perform input actions,the type of the output is str.

3.When we need to change str into number,we should force type conversion which is mains add “int”.

4.”**” mains return y power of x,and ”//”mains turn down an integer close to the divisor.

5.Any non-zero number and any non-null number is true,and 0 or None is False in python environment.

6.The statement after if must have space.

7.Introducing import random mains “import random”,and randomly generating integer mains “x=random.randint(0,10)”.

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/689531.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号