zhishi=' '
while zhishi!='quit':
zhishi=raw_input('please give me the command\n')
list=zhishi.split()
def add():
print 'add'
def remove():
print 'remove'
if list[0]=='a':
add()
break
if list[0]=='r':
remove()
break
被人鄙视所以重发改好缩进的版本
flag=True
while flag:
zhishi=raw_input('please give me the command\n')
list=zhishi.split()
def add():
print 'add a street'
def remove():
print 'remove a street'
if list[0]=='a':
add()
break
if list[0]=='r':
remove()
break
你自己都知道缩进有问题,那就把缩进改好了再发上来,
#!/usr/bin python