类似于使用带参数的函数
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 variable is:", third
输入为采用
raw_input
例如:
a=raw_input();print a
用<提示需要进行输入
a=raw_input('<');print a
python中定义函数:
实现a和b相加
def add(a,b):
return a+b
a=1
b=3
c=add(1,3)
print "%d"%c
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 variable is:", third
输入为采用
raw_input
例如:
a=raw_input();print a
用<提示需要进行输入
a=raw_input('<');print a
python中定义函数:
实现a和b相加
def add(a,b):
return a+b
a=1
b=3
c=add(1,3)
print "%d"%c