把字符串首字母大写,其余小写

def strUpLow(s):
	n = 0
	for a in s:
		if n == 0:
			b = s[n].upper()
		else:
			b += s[n].lower()
		n += 1
	print b

测试:



猜你喜欢

转载自blog.csdn.net/GBA_Eagle/article/details/80751238