VBA 格式化字符串 VBA 的 Format 函数与工作表函数 TEXT 用法基本相同,但功能更加强大,许多格式只能用于VBA 的 Format 函数,而不能用于工作表函数 TEXT ,以下是本人归纳的几点用法,希望对学习VBA有所裨益.Format(值,格式(可选参数))一.数字格式:1.General Number:普通数字,可以用来去掉千位分隔号和无效 0 .如:Format("1,234,567.80", "General Number")="1
Python的字符串格式化有两种方式: 百分号方式.format方式 百分号的方式相对来说比较老,而format方式则是比较先进的方式,企图替换古老的方式,目前两者并存.[PEP-3101] This PEP proposes a new system for built-in string formatting operations, intended as a replacement for the existing '%' string formatting operator. 1.百分号
Python的字符串格式化有两种方式: 百分号方式.format方式 百分号的方式相对来说比较老,而format方式则是比较先进的方式,企图替换古老的方式,目前两者并存.[PEP-3101] This PEP proposes a new system for built-in string formatting operations, intended as a replacement for the existing '%' string formatting operator. 1.百分号
字符串格式化 Python的字符串格式化有两种方式: 百分号方式.format方式 百分号的方式相对来说比较老,而format方式则是比较先进的方式,企图替换古老的方式,目前两者并存.[PEP-3101] This PEP proposes a new system for built-in string formatting operations, intended as a replacement for the existing '%' string formatting operator
字符串格式化 %s 可以接收任何值, %d只能接收整形 .其他类型报错 msg ='i am %s my body' %'ales' print(msg) #i am ales my body msg ='i am %s my body is %s' %('alex','xiaoming') #穿多个值加括号 print(msg) #i am alex my body is xiaoming 打印浮点数 tpl = "percent %f" %99.978979934 print(tp
可变数据类型与不可变数据类型: 1.可变:列表,字典 2.不可变:字符串,数字,元组 访问顺序: 1.顺序访问:字符串,列表,元组 2.映射:字典 集合 由不同元素组成的集合,集合中是一组无序排列的可hash的值,可以作为字典的key 1.不同元素组成 2.无序 3.集合中元素必须是不可变类型,如:字符串,数字,元组 集合的定义:s={1,2,5,6,7} s = {0,1,2,4,5,6,7,7,7,8,9}for i in s : print(i) v={(1,2,3,),5} for i