2006年01月01日 星期日 21:02
def cout(s):
a=1;b=2;c=3;d=4;e=5
aa=[a,b,c,d,e]
p=0
while p<=s:
aa[p]=raw_input('Enter:')
p=p+1
很明显我用了一个比较笨的办法来声明一个序列然后使用
以前学过C++,那里在用前可以先声明一个数组占用一段空的内存位置出来
Python里目前还没学到有先声明出位置然后使用的
请问是怎么做呢?
(翻了手里的书,还有简明教程,都咱未提到,想搜索又不知道从何搜起。只有劳牛人解答了)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060101/22260ed9/attachment.htm
2006年01月01日 星期日 21:14
你想干嘛 在 06-1-1,风向标-Vane<vaneoooo at gmail.com> 写道: > > > def cout(s): > a=1;b=2;c=3;d=4;e=5 > aa=[a,b,c,d,e] > p=0 > while p<=s: > aa[p]=raw_input('Enter:') > p=p+1 > 很明显我用了一个比较笨的办法来声明一个序列然后使用 > 以前学过C++,那里在用前可以先声明一个数组占用一段空的内存位置出来 > Python里目前还没学到有先声明出位置然后使用的 > 请问是怎么做呢? > > (翻了手里的书,还有简明教程,都咱未提到,想搜索又不知道从何搜起。只有劳牛人解答了) > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to > python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to > python-chinese-request at lists.python.cn > Detail Info: > http://python.cn/mailman/listinfo/python-chinese > >
2006年01月01日 星期日 21:19
自己觉得动手能力差 给自己出了一题 统计若干个学生成绩 录入 加起来,然后求平均 到这第一步录入的时候觉得应该可以有更简便的方法 否则万一我统计一个班,60个学生的数据 岂不是要声明60个变量 在06-1-1,xxmplus <xxmplus at gmail.com> 写道: > > 你想干嘛 > > 在 06-1-1,风向标-Vane<vaneoooo at gmail.com> 写道: > > > > > > def cout(s): > > a=1;b=2;c=3;d=4;e=5 > > aa=[a,b,c,d,e] > > p=0 > > while p<=s: > > aa[p]=raw_input('Enter:') > > p=p+1 > > 很明显我用了一个比较笨的办法来声明一个序列然后使用 > > 以前学过C++,那里在用前可以先声明一个数组占用一段空的内存位置出来 > > Python里目前还没学到有先声明出位置然后使用的 > > 请问是怎么做呢? > > > > (翻了手里的书,还有简明教程,都咱未提到,想搜索又不知道从何搜起。只有劳牛人解答了) > > _______________________________________________ > > python-chinese > > Post: send python-chinese at lists.python.cn > > Subscribe: send subscribe to > > python-chinese-request at lists.python.cn > > Unsubscribe: send unsubscribe to > > python-chinese-request at lists.python.cn > > Detail Info: > > http://python.cn/mailman/listinfo/python-chinese > > > > > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060101/8fcdcb4a/attachment.html
2006年01月01日 星期日 21:25
a=[0]*60
for x in range(60):
a[x]=input('请输入学生成绩')
在06-1-1,风向标-Vane <vaneoooo at gmail.com> 写道:
>
> 自己觉得动手能力差
> 给自己出了一题
> 统计若干个学生成绩
> 录入
> 加起来,然后求平均
> 到这第一步录入的时候觉得应该可以有更简便的方法
> 否则万一我统计一个班,60个学生的数据
> 岂不是要声明60个变量
>
>
> 在06-1-1,xxmplus <xxmplus at gmail.com> 写道:
> >
> > 你想干嘛
> >
> > 在 06-1-1,风向标-Vane<vaneoooo at gmail.com> 写道:
> > >
> > >
> > > def cout(s):
> > > a=1;b=2;c=3;d=4;e=5
> > > aa=[a,b,c,d,e]
> > > p=0
> > > while p<=s:
> > > aa[p]=raw_input('Enter:')
> > > p=p+1
> > > 很明显我用了一个比较笨的办法来声明一个序列然后使用
> > > 以前学过C++,那里在用前可以先声明一个数组占用一段空的内存位置出来
> > > Python里目前还没学到有先声明出位置然后使用的
> > > 请问是怎么做呢?
> > >
> > > (翻了手里的书,还有简明教程,都咱未提到,想搜索又不知道从何搜起。只有劳牛人解答了)
> > > _______________________________________________
> > > python-chinese
> > > Post: send python-chinese at lists.python.cn
> > > Subscribe: send subscribe to
> > > python-chinese-request at lists.python.cn
> > > Unsubscribe: send unsubscribe to
> > > python-chinese-request at lists.python.cn
> > > Detail Info:
> > > http://python.cn/mailman/listinfo/python-chinese
> > >
> > >
> >
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese at lists.python.cn
> > Subscribe: send subscribe to python-chinese-request at lists.python.cn
> > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >
> >
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>
--
开飞机的舒克
http://www.lvye.org/shuke
msn:weizhong at netease.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060101/62694de9/attachment.htm
2006年01月02日 星期一 00:43
直接append a=[] a.append(x) 在 06-1-1,魏忠<weizhong2004 at gmail.com> 写道: > a=[0]*60 > for x in range(60): > a[x]=input('请输入学生成绩') > > > 在06-1-1,风向标-Vane <vaneoooo at gmail.com> 写道: > > > > 自己觉得动手能力差 > > 给自己出了一题 > > 统计若干个学生成绩 > > 录入 > > 加起来,然后求平均 > > 到这第一步录入的时候觉得应该可以有更简便的方法 > > 否则万一我统计一个班,60个学生的数据 > > 岂不是要声明60个变量 > > > > > > 在06-1-1,xxmplus <xxmplus at gmail.com> 写道: > > > > > 你想干嘛 > > > > > > 在 06-1-1,风向标-Vane< vaneoooo at gmail.com> 写道: > > > > > > > > > > > > def cout(s): > > > > a=1;b=2;c=3;d=4;e=5 > > > > aa=[a,b,c,d,e] > > > > p=0 > > > > while p<=s: > > > > aa[p]=raw_input('Enter:') > > > > p=p+1 > > > > 很明显我用了一个比较笨的办法来声明一个序列然后使用 > > > > 以前学过C++,那里在用前可以先声明一个数组占用一段空的内存位置出来 > > > > Python里目前还没学到有先声明出位置然后使用的 > > > > 请问是怎么做呢? > > > > > > > > (翻了手里的书,还有简明教程,都咱未提到,想搜索又不知道从何搜起。只有劳牛人解答了) > > > > _______________________________________________ > > > > python-chinese > > > > Post: send python-chinese at lists.python.cn > > > > Subscribe: send subscribe to > > > > python-chinese-request at lists.python.cn > > > > Unsubscribe: send unsubscribe to > > > > python-chinese-request at lists.python.cn > > > > Detail Info: > > > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese at lists.python.cn > > > Subscribe: send subscribe to > python-chinese-request at lists.python.cn > > > Unsubscribe: send unsubscribe to > python-chinese-request at lists.python.cn > > > Detail Info: > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese at lists.python.cn > > Subscribe: send subscribe to > python-chinese-request at lists.python.cn > > Unsubscribe: send unsubscribe to > python-chinese-request at lists.python.cn > > Detail Info: > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > -- > > 开飞机的舒克 > http://www.lvye.org/shuke > msn:weizhong at netease.com > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to > python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to > python-chinese-request at lists.python.cn > Detail Info: > http://python.cn/mailman/listinfo/python-chinese > >
Zeuux © 2025
京ICP备05028076号