2022年12月11日

摘要: 什么是格式化 定义:一个固定的字符串中有部分元素是根据变量的值而改变的字符串 今天是xx,星期xx,大家好 date = '2022.1211' day = '--' 根据类型定义的格式化 'my name is %s, my age is %s' % ('dewei', 33) #coding:u 阅读全文
posted @ 2022-12-11 22:11 bobo2404 阅读(23) 评论(0) 推荐(0) 编辑
 
摘要: 常见编码格式 # coding:ascii print('哈哈') # ?? print('haha') # haha#coding: gbk 支持英文 通用编码格式 utf-8 是一种国际通用的编码格式 阅读全文
posted @ 2022-12-11 20:49 bobo2404 阅读(24) 评论(0) 推荐(0) 编辑
 
摘要: #isspace istitle isupper islower#isspace 判断字符串是否是一个由空格组成的字符串booltype = string.isspace() -> 无参数可传,返回一个布尔类型#由空格组成的字符串,不是空字符串:!=''#istitle 判断字符串是否是一个标题类型 阅读全文
posted @ 2022-12-11 20:41 bobo2404 阅读(77) 评论(0) 推荐(0) 编辑