技术
weixin_51178358
这个作者很懒,什么都没留下…
展开
-
python办公自动化-1
import os print(os.getcwd()) #获取当前python程序运行路径 print(os.path.join('a','b')) #路径连接,os.path.join(第一个,第二个,第三个,...) print(os.listdir()) #当前文件夹下所有文件和文件夹,输出的是列表 print(os.listdir('e:/')) #绝对路径,‘e:\\’也行 print(os.listdir('./lib')) #相对路径 files = os.listdir(.原创 2020-10-27 20:18:24 · 56 阅读 · 0 评论 -
python基础-2
n = 3 if n % 2 >0: print(f'数字{n}是奇数') else: print(f'数字{n}是偶数') a, b, c = 4, 2, 3 if a > b and a > c: print(a) elif b > a and b > c: print(b) else: print(c) score = 53 if score < 0 or score > 100: print('您输入的数.原创 2020-10-27 20:12:28 · 108 阅读 · 1 评论 -
python基础-1
a,b,c = 1,2,3 name = 'abcdefg' print(a,b,c) print(name[0], name[-1], len(name), name.upper(), name.replace('a','x')) #从右往左从-1开始 print( a>0 and b>0) print( not a>0 ) print(name[1:3]) #截取字符串 print(name[::-1]) #倒序 name = 'I\'m a maker' #转义 a.原创 2020-10-27 20:10:33 · 53 阅读 · 0 评论