大家好,小编来为大家解答以下问题,笨办法学python 3电子书下载,笨办法学python3 pdf百度云,今天让我们一起来看看吧!

Source code download: 本文相关源码
# coding=utf-8
# argv 是所谓的“参数变量(argument variable)”,变量包含了你传递给 Python 的参数
from sys import argv
# argv “解包(unpack)”,与其将所有参数放到同一个变量下面,我们将每个参数赋予一个变量名:
,first,sencond,third = argv
print("The is called:",)
print("Your first variable is:",first)
print("Your second variable is:",sencond)
print("Your third variable is:",third)
'''
报错信息:
ValueError: not enough values to unpack (expected 4, got 3) # 参数个数不符
(注意你必须传递*三*个参数)
'''
"""
# 加强脚本代码
,s1,s2 = argv
input_1 = input("Your"+s1+"is:")
input_2 = input("Your"+s2+"is:")
print("Your input %s is:%s" % (s1,input_1))


839

被折叠的 条评论
为什么被折叠?



