python学习,第二天笔记

#强制转换
#a = "1";
#b = "2";
#print a + b;
#print int(a) + int(b);
#12
#3

#首字母大写
#a = "please call me ck";
#b = "PLEASE CALL ME CK";
#print a.capitalize();
#print b.capitalize();
#Please call me ck
#Please call me ck

#大小写互换
#a = "My name is CK";
#print a.swapcase();
#mY NAME IS ck

#截取字符串
#a = "call me ck";
#print a[0:6];
#call m

#各种判断
#a = "Abcdef";
#print a.isalpha();#所有字符都是A-Z或a-z
#print a.isalnum();#是否所有字符都是数字或者A-Z或者a-z
#print a.isdigit();#是否所有字符都是数字
#print a.islower();#是否都是小写
#print a.isupper();#是否都是大写
#print a.istitle();#是否首字母为大写
#print a.isspace();#是否所有字符都是空白符\n,\t,\r,' '
#True
#True
#False
#False
#False
#True
#False

#在字符串查找子串
#a = "my name is ck ck";
#print a.find("ck"); #
#print a.find("my", 1);#从1开始查找字符串
#print a.rfind("ck");#反向查找字符串
#11
#-1
#14
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值