range(10, 0, -1) # [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
print('Hao123'.isdigit()) # 所有字符都是数字吗?
digit :(从 0 到 9 的任何一个) 数字
print('hello.tar.gz'.split('.')) #分离 以·为分割标志 =>['hello', 'tar', 'gz']
print('.'.join(['hello','tar','gz'])) #合并 是split和join是相反的
# "%s is %d years old" % ('bob', 23) # 常用
# "%s is %d years old" % ('bob', 23.5) # %d是整数 常用
# "%s is %f years old" % ('bob', 23.5)
# a = "{} is {} years old".format('bob', 25)
# b ="{1} is {0} years old".format(25, 'bob')
- 记得学习下,python对文件操作