会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
大罪人
博客园
首页
新随笔
联系
订阅
管理
2021年3月
数据类型
摘要: 1.数字 2.整数 (1)int #整型 32位机器上,整数的位数为32位,取值范围为-2**31~2**31-1,即-2147483648~2147483647 64位机器上,整数的位数为64位,取值范围为-2**63~2**63-1,即-9223372036854775808~922337203
阅读全文
posted @ 2021-03-03 19:16 大罪人
阅读(33)
评论(0)
推荐(0)
2020年10月
循环
摘要: while 循环: count = 0 while True: print("count:",count) count += 1 if count == 1000: break #break跳出当前循环 count = 0 while True: if count = 1000: break pri
阅读全文
posted @ 2020-10-04 12:40 大罪人
阅读(96)
评论(0)
推荐(0)
2020年9月
python输入密码的隐藏及判断语句
摘要: 1 import getpass 2 3 username = input("username:") 4 password = input("password:") 5 6 if_username == username and _password == password: 7 print("wel
阅读全文
posted @ 2020-09-26 22:43 大罪人
阅读(280)
评论(0)
推荐(0)
2020年8月
字符编码及格式化输出
摘要: python解释器在加载.py文件中的代码时,会对内容进行编码(默认为ASCII) #-*-coding: utf-8 -*- python默认utf-8 注释: #用来进行单行注释 ''' '''用来多行注释,同时也可打印多行 name = '''1,2,3''' print(name) 用户输入
阅读全文
posted @ 2020-08-26 14:43 大罪人
阅读(131)
评论(0)
推荐(0)
2020年7月
变量
摘要: 声明变量 #_*_coding:utf-8_*_name = "Masked Rider" #定义变量print("My name is", name) #输出变量 变量名只能是字母,数字或者下划线的任意组合,变量名的第一个字符不能是数字 以下关键字不能声明变量名 #'and','as','asse
阅读全文
posted @ 2020-07-27 12:46 大罪人
阅读(146)
评论(0)
推荐(0)
Hello World
摘要: 在linux下创建一个文件夹hello world.py并输入 print("hello,world") 然后执行命令:Python hello world.py输出 如果想要类似执行shell脚本一样执行Python脚本。那么就需要在文件头部指定解释器。 例: #!/usr/bin/env pyt
阅读全文
posted @ 2020-07-24 12:31 大罪人
阅读(107)
评论(0)
推荐(0)
公告