【笨方法学python】ex13 - 参数、解包、变量

代码如下:

点击查看代码
# -*-coding:utf-8- -*-
# 参数、解包、变量

from sys import argv
# argv 是所谓的 “参数变量” ,是一个非常标准的编程术语。
# 包含了你传递给 python 的参数。

script, first, second, third = argv

print "The script is called:", script
print "Your first variable is:", first
print "Your second variable is:", second
print "Your third variable is:", third

执行结果:
image

posted @ 2022-10-05 04:23  TiramisuPS  阅读(20)  评论(0编辑  收藏  举报