程序代码:
from sys import argv
# read the WYSS section for how to run this
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)
输出结果:
PS D:\lpthw> python ex13.py 1 2 3
The script is called: ex13.py
Your first variable is: 1
Your second variable is: 2
Your third variable is: 3
repr() 函数使用说明
返回值
返回一个对象的 string 格式。
实例
以下展示了使用 repr() 方法的实例:
>>>s = 'RUNOOB'
>>> repr(s)
"'RUNOOB'"
>>> dict = {'runoob': 'runoob.com', 'google': 'google.com'};
>>> repr(dict)
"{'google': 'google.com', 'runoob': 'runoob.com'}"
>>>