python全栈(五)基本数据类型
#数字比作猎人<br />num = 123<br />v = num.bit_length()<br />print(v)<br />#字符串:女巫<br />name1 = 'shizhengwen'<br />v1 = name1.upper()<br />print(v1)<br /><br />name2 = 'laiying'<br />v2 = name2.upper()<br />print(v2)<br /><br />#整形,int<br />#python3里,122333344,不管数字有多大,都是int类型<br />#python2里,123344<br />#长整形,long<br />#python2里,12233444 long<br />#========python3 =========<br />#数字 int,所有的工功能,都放在int 里<br />#在python3里,1222222222223333333<br />#字符串 str<br />#列表 list<br />#元祖 tuple<br />#字典 dict <br />#布尔值 bool <br /><br />
- int<br /> 将字符串转换为数字<br /> a = '123'<br /> b = int(a)<br /> b = b + 1000
相关推荐
YENCSDN 2020-11-17
lsjweiyi 2020-11-17
houmenghu 2020-11-17
Erick 2020-11-17
HeyShHeyou 2020-11-17
以梦为马不负韶华 2020-10-20
lhtzbj 2020-11-17
夜斗不是神 2020-11-17
pythonjw 2020-11-17
dingwun 2020-11-16
lhxxhl 2020-11-16
坚持是一种品质 2020-11-16
染血白衣 2020-11-16
huavhuahua 2020-11-20
meylovezn 2020-11-20
逍遥友 2020-11-20
weiiron 2020-11-16