python日常 常用函数

Last updated on November 22, 2024 pm

🧙 Questions

python中常用的函数

☄️ Ideas

字符串切割
username='zhang san'
names=username.split(" ")
for name in names:
	print(name)
print("firstName:"+names[0])	
print("lastName:"+names[1])
字符串包含于
if "baidu" in a
获取输入参数
import sys

print(sys.argv)
# ['C:/Users/ispon/Documents/isxocde.com/leo-tensorflow/demos/gitlab/gitlab.py', 'merge', 'papaas']

sys.argv[1]
sys.argv[2]
执行系统命令
import os
os.system('dir')

python日常 常用函数
https://ispong.isxcode.com/pytorch/python/python日常 常用函数/
Author
ispong
Posted on
March 24, 2022
Licensed under