python在shell里如何写for循环

一、如图,先写一行for循环,记得写“:”,然后在下行缩进写逻辑,然后点两下回车,程序就会运行了

方法二,写脚本

注意权限用chmod命令、python文件位置用which python查询,运行./fortest或python fortest

方法三

print([bb for bb in list1])

猜你喜欢

转载自blog.csdn.net/qq_36045385/article/details/81391839