码迷,mamicode.com
首页 >  
搜索关键字:isdigit    ( 345个结果
[Python3 填坑] 002 isdecimal() 与 isdigit() 的区别 + isnumeric() 的补充
1. 挖坑日期:2019/01/14;2. 总结了 isdecimal()、isdigit()、isnumeric() 三者对于字符串中 Unicode 数字,全角数字,半角数字,罗马数字,汉字数字和小数的输出结果;3. 分别举例说明;4. 找到了 isdecimal() 与 isdigit() ... ...
分类:编程语言   时间:2019-01-15 14:05:16    阅读次数:225
isdigit()
isdigit() 是字符串的一个方法,用来判断这个字符串是否是纯数字的字符串 ...
分类:其他好文   时间:2019-01-13 11:38:57    阅读次数:154
Python全栈之路---数据类型—字符串
字符串:有序的字符的集合,用于存储和表示基本的文本信息,一对单、双、或三引号中间包含的内容称之为字符串 1.特性:有序,不可变(开辟新地址存储字符串,python解释器会定期清空不用了的已存储的) 2.操作 常用:isdigit replace find count strip center spl ...
分类:编程语言   时间:2019-01-12 00:28:20    阅读次数:244
python学习(29)
习题:习题1:把一个文件中的所有数字删除方式1:#encoding=utf-8content_list=[]withopen("e:\\a.txt")asfile_obj:forlineinfile_obj:forcinline:ifc.isdigit():line=line.replace(c,"")content_list.append(line)withopen("e:\\a.txt","w
分类:编程语言   时间:2019-01-10 11:24:48    阅读次数:152
python格式化输出
name = input("Name:") age = input("Age:") job = input("job:") salary = input("Salary:") if salary.isdigit(): # 判断是不是整数 salary = int(salary) else: exit... ...
分类:编程语言   时间:2019-01-10 01:10:58    阅读次数:196
在字典的三级菜单中添加内容
li = [] go = True while go: for i,v in enumerate(dic,1): li.append(v) print(i,v) u_c = str(input(">>>")) if u_c.isdigit(): u_c = int(u_c) li1 = [] ... ...
分类:其他好文   时间:2019-01-08 19:25:21    阅读次数:111
Python习题
1.用算法判断某?一个字符串串是否是?小数s17 = "-123.12"s17 = s17.replace("-", "") #替换掉负号if s17.isdigit(): print("是整数")else: if s17.count(".") == 1 and not s17.startswith... ...
分类:编程语言   时间:2019-01-03 19:36:23    阅读次数:178
关于__int 128 的读入与输出
inline __int128 read() { int X=0,w=0; char ch=0; while(!isdigit(ch)) {w|=ch=='-';ch=getchar();} while(isdigit(ch)) X=(X9) print(x/10); putchar(x%10+'0... ...
分类:其他好文   时间:2018-12-31 15:43:36    阅读次数:517
Python第三天2
python的字符串内建函数 captlze 首字母大写 upper() 全大写 lower() 全小写 find 通过元素找索引,找不到-1 index()通过元素找索引,找不到报错 swpease 大小写翻转 repalce(old,new,count)替换 isdigit() 返回bool值 ...
分类:编程语言   时间:2018-12-28 20:45:11    阅读次数:202
Python 字符串格式化
字符格式化输出 isdigit # 是否是数字 占位符: %s %d %f print (%s ,%d,%s %(1,2,3,)) 例子: ...
分类:编程语言   时间:2018-12-24 16:13:16    阅读次数:150
345条   上一页 1 ... 8 9 10 11 12 ... 35 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!