首页 > 编程语言 >【笨方法学python】ex13 - 参数、解包、变量

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

时间:2022-10-05 04:33:47浏览次数:55  
标签:third script python ex13 解包 argv print

代码如下:

点击查看代码
# -*-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

标签:third,script,python,ex13,解包,argv,print
From: https://www.cnblogs.com/TiramisuPS/p/16754975.html

相关文章