笨办法学python:参数、解包、变量

mac2022-06-30  59

附加题:

3. 将 raw_input 和 argv 一起使用,让你的脚本从用户手上得到更多的输入

from sys import argv script,s1,s2=argv input_1 = raw_input("Your" + s1 +"is:") input_2 = raw_input("your"+s2+"is:") print "your input %s is: %s"%(s1,input_1) print "your input %s is : %s"%(s2,input_2)

 

转载于:https://www.cnblogs.com/luckyraye/p/7818932.html

相关资源:笨办法学 Python(Learn Python The Hard Way)(第4版)
最新回复(0)