新手求救python高手..我用的是python27..

[复制链接]
查看11 | 回复2 | 2012-2-3 15:19:57 | 显示全部楼层 |阅读模式
两个问题的代码都帮你写出来了,其中都有“输入的合法性校验”,这样可以提高程序的健壮性。有不明白的地方可以继续提问。问题(2):def initList():
'Function : initList for initing the list for program.'
theList=['','','','','',.......................]
# Init your list for this program.
return theListdef outPut(List):
'Function : output the result for client.'
while ...
回复

使用道具 举报

千问 | 2012-2-3 15:19:57 | 显示全部楼层
我也是python初学者,这个问题可以用如下代码解决:list1=['a','b','c','d','e','f','g','h','i','j']#列表中字母可替换成相应的文字项目list2=[]n=range(10)for i in n: input=raw_input('please enter a number:')
#请...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行