码迷,mamicode.com
首页 > 编程语言 > 详细

python02

时间:2016-10-22 07:23:54      阅读:148      评论:0      收藏:0      [点我收藏+]

标签:strip()   str   app   strip   round   append   5.6   names   rem   

# print (msg.capitalize())
# print (msg.center(10,"*")) 以*分割 一共20字节 居中分割
# print (msg.endswith(‘d‘))
# print (msg.count(‘d‘,0,11)) 统计字符有几个
# print (‘{1},{2} {0} {2} ‘.format(‘name‘,‘age‘, "bsk")) 传参
#
# print (msg1.isalnum())
# print (msg1.isalpha())
# print (msg.istitle()) 首字母是否大写
# print (msg.isupper()) 全是大写

msg=‘abc‘
#print (msg.ljust(10,‘*‘)) 左对齐

# print (msg.rjust(8,‘‘))

#print (msg.lower()) 变小写
# print (msg.upper()) 变大写

# print (msg.rstrip()) 右去空格 lstrip strip
#kk=str.maketrans(‘abc‘,‘bsk‘) 翻译
#print (msg.translate(kk)) 翻译打印
# print (msg.zfill(20))
# print (msg.ljust(20))
# print (msg.rjust(20))
#print.(msg.strip())
# msg=5.6
# round(4.5)


# oldboyage=26
#
# count = 1
# while count < 3 :
# age= input("Please input your age:")
# if age.isdigit():
# age = int(getage)
# else:
# continue
# if age>26:
# print ("往小里猜")
# elif age < 26:
# print ("往大里猜")
# else:
# print ("恭喜你猜对了!")
#
# count += 1
#
#
# names.remove("字符")
# del names[2]
# names.pop()
# names.index()
# names.append()


# names = [‘a‘,‘b‘,‘c‘,‘d‘,]
# names.append(‘e‘)
# names.count(‘b‘)
# names

python02

标签:strip()   str   app   strip   round   append   5.6   names   rem   

原文地址:http://www.cnblogs.com/bskk/p/5986467.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!