Exercise 13 - parameters, unpacking, variables
from sys import argv
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 vaiable is:", third)
output
PS: 在终端输入参数
D:\>python ex13.py 1st 2nd 3rd
The script is called: ex13.py
Your first variable is: 1st
Your second variable is: 2nd
Your third vaiable is: 3rd
2019-09-27
16:17:09
posted on 2019-09-27 12:17 petit_herisson 阅读(100) 评论(0) 收藏 举报
浙公网安备 33010602011771号