Python论坛  - 讨论区

标题:[python-chinese] 程序的一个问题

2007年06月27日 星期三 18:31

王顺翔 wsxpython在gmail.com
星期三 六月 27 18:31:12 HKT 2007

a=1
while a<10:
    a=a+1
    print a
    print float(1/a)

Êä³ö£º
2
0.0
3
0.0
4
0.0
5
0.0
6
0.0
7
0.0
8
0.0
9
0.0
10
0.0

ÈçºÎÈÃСÊýµãºóÃæÓÐÒâÒåÄØ£¿ ÎÒµÄÒâ˼¶¼¿´µÃ¶®°É£¿ ÕýÈ·µÄ¸ÃÔõô±àÄØ£¿
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20070627/8d947d03/attachment.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年06月27日 星期三 18:34

刘鑫 march.liu在gmail.com
星期三 六月 27 18:34:55 HKT 2007

1.0/a

ÔÚ07-6-27£¬Íõ˳Ïè <wsxpython在gmail.com> дµÀ£º
>
> a=1
> while a<10:
>     a=a+1
>     print a
>     print float(1/a)
>
> Êä³ö£º
> 2
> 0.0
> 3
> 0.0
> 4
> 0.0
> 5
> 0.0
> 6
> 0.0
> 7
> 0.0
> 8
> 0.0
> 9
> 0.0
> 10
> 0.0
>
> ÈçºÎÈÃСÊýµãºóÃæÓÐÒâÒåÄØ£¿ ÎÒµÄÒâ˼¶¼¿´µÃ¶®°É£¿ ÕýÈ·µÄ¸ÃÔõô±àÄØ£¿
>
>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>



-- 
²Ë²»Ò»¶¨°×£¬°×²»Ò»¶¨²Ë
°×ÊÇÒ»ÖÖ¾³½ç£¬°×ÈËÓÀÔ¶ÊÇ°×µÄ

ÁõöÎ
March.Liu
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20070627/e352d94a/attachment.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年06月27日 星期三 18:48

limon lin limon7在gmail.com
星期三 六月 27 18:48:44 HKT 2007

print 1.0/a

在07-6-27,王顺翔 <wsxpython at gmail.com> 写道:
>
> a=1
> while a<10:
>     a=a+1
>     print a
>     print float(1/a)
>
> 输出:
> 2
> 0.0
> 3
> 0.0
> 4
> 0.0
> 5
> 0.0
> 6
> 0.0
> 7
> 0.0
> 8
> 0.0
> 9
> 0.0
> 10
> 0.0
>
> 如何让小数点后面有意义呢? 我的意思都看得懂吧? 正确的该怎么编呢?
>
>
> _______________________________________________
> 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://python.cn/pipermail/python-chinese/attachments/20070627/de920d99/attachment.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年06月27日 星期三 19:03

王顺翔 wsxpython在gmail.com
星期三 六月 27 19:03:52 HKT 2007

лл¡«£¡
limon£¬ ×òÌìÍíÉÏÔÚÎÒ²©¿ÍÉÏÁôÑÔµÄÒ²ÊÇÄã°É£¿ ¾ÍÊÇì³²¨ÄÇÆõÊýÁеÄÄǸö¡«¡«£º£©

ÔÚ07-6-27£¬limon lin <limon7在gmail.com> дµÀ£º
>
> print 1.0/a
>
> ÔÚ07-6-27£¬Íõ˳Ïè <wsxpython在gmail.com> дµÀ£º
> >
> > a=1
> > while a<10:
> >     a=a+1
> >     print a
> >     print float(1/a)
> >
> > Êä³ö£º
> > 2
> > 0.0
> > 3
> > 0.0
> > 4
> > 0.0
> > 5
> > 0.0
> > 6
> > 0.0
> > 7
> > 0.0
> > 8
> > 0.0
> > 9
> > 0.0
> > 10
> > 0.0
> >
> > ÈçºÎÈÃСÊýµãºóÃæÓÐÒâÒåÄØ£¿ ÎÒµÄÒâ˼¶¼¿´µÃ¶®°É£¿ ÕýÈ·µÄ¸ÃÔõô±àÄØ£¿
> >
> >
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese在lists.python.cn
> > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > Unsubscribe: send unsubscribe to
> > python-chinese-request在lists.python.cn
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >
>
>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20070627/985489ba/attachment.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年06月27日 星期三 19:10

limon lin limon7在gmail.com
星期三 六月 27 19:10:13 HKT 2007

呵呵,随便逛到的,真巧

在07-6-27,王顺翔 <wsxpython at gmail.com> 写道:
>
> 谢谢~!
> limon, 昨天晚上在我博客上留言的也是你吧? 就是斐波那契数列的那个~~:)
>
> 在07-6-27,limon lin <limon7 at gmail.com> 写道:
> >
> > print 1.0/a
> >
> > 在07-6-27,王顺翔 < wsxpython at gmail.com> 写道:
> > >
> > > a=1
> > > while a<10:
> > >     a=a+1
> > >     print a
> > >     print float(1/a)
> > >
> > > 输出:
> > > 2
> > > 0.0
> > > 3
> > > 0.0
> > > 4
> > > 0.0
> > > 5
> > > 0.0
> > > 6
> > > 0.0
> > > 7
> > > 0.0
> > > 8
> > > 0.0
> > > 9
> > > 0.0
> > > 10
> > > 0.0
> > >
> > > 如何让小数点后面有意义呢? 我的意思都看得懂吧? 正确的该怎么编呢?
> > >
> > >
> > > _______________________________________________
> > > 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://python.cn/pipermail/python-chinese/attachments/20070627/58aaec3f/attachment.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年06月27日 星期三 19:40

王顺翔 wsxpython在gmail.com
星期三 六月 27 19:40:06 HKT 2007

Ô­À´ÍøÂçÕâôС¡«¡« ºÇºÇ¡«¡« ÒªÄãÊÇÅ®µÄ£¬ ÎÒ¾ÍÈ¢ÄãÁË¡«£º£©

ÔÚ07-6-27£¬limon lin <limon7在gmail.com> дµÀ£º
>
> ºÇºÇ£¬Ëæ±ã¹äµ½µÄ£¬ÕæÇÉ
>
> ÔÚ07-6-27£¬Íõ˳Ïè <wsxpython在gmail.com> дµÀ£º
> >
> > лл¡«£¡
> > limon£¬ ×òÌìÍíÉÏÔÚÎÒ²©¿ÍÉÏÁôÑÔµÄÒ²ÊÇÄã°É£¿ ¾ÍÊÇì³²¨ÄÇÆõÊýÁеÄÄǸö¡«¡«£º£©
> >
> > ÔÚ07-6-27£¬limon lin < limon7在gmail.com> дµÀ£º
> > >
> > > print 1.0/a
> > >
> > > ÔÚ07-6-27£¬Íõ˳Ïè < wsxpython在gmail.com> дµÀ£º
> > > >
> > > > a=1
> > > > while a<10:
> > > >     a=a+1
> > > >     print a
> > > >     print float(1/a)
> > > >
> > > > Êä³ö£º
> > > > 2
> > > > 0.0
> > > > 3
> > > > 0.0
> > > > 4
> > > > 0.0
> > > > 5
> > > > 0.0
> > > > 6
> > > > 0.0
> > > > 7
> > > > 0.0
> > > > 8
> > > > 0.0
> > > > 9
> > > > 0.0
> > > > 10
> > > > 0.0
> > > >
> > > > ÈçºÎÈÃСÊýµãºóÃæÓÐÒâÒåÄØ£¿ ÎÒµÄÒâ˼¶¼¿´µÃ¶®°É£¿ ÕýÈ·µÄ¸ÃÔõô±àÄØ£¿
> > > >
> > > >
> > > > _______________________________________________
> > > > python-chinese
> > > > Post: send python-chinese在lists.python.cn
> > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > > > Unsubscribe: send unsubscribe to
> > > > python-chinese-request在lists.python.cn
> > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> > > >
> > >
> > >
> > > _______________________________________________
> > > python-chinese
> > > Post: send python-chinese在lists.python.cn
> > > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > > Unsubscribe: send unsubscribe to
> > > python-chinese-request在lists.python.cn
> > > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> > >
> >
> >
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese在lists.python.cn
> > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > Unsubscribe: send unsubscribe to
> > python-chinese-request在lists.python.cn
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >
>
>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20070627/f1e5a10e/attachment-0001.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年06月27日 星期三 20:05

limon lin limon7在gmail.com
星期三 六月 27 20:05:16 HKT 2007

-.-||

在07-6-27,王顺翔 <wsxpython at gmail.com> 写道:
>
> 原来网络这么小~~ 呵呵~~ 要你是女的, 我就娶你了~:)
>
> 在07-6-27,limon lin <limon7 at gmail.com> 写道:
> >
> > 呵呵,随便逛到的,真巧
> >
> > 在07-6-27,王顺翔 < wsxpython at gmail.com> 写道:
> > >
> > > 谢谢~!
> > > limon, 昨天晚上在我博客上留言的也是你吧? 就是斐波那契数列的那个~~:)
> > >
> > > 在07-6-27,limon lin < limon7 at gmail.com> 写道:
> > > >
> > > > print 1.0/a
> > > >
> > > > 在07-6-27,王顺翔 < wsxpython at gmail.com> 写道:
> > > > >
> > > > > a=1
> > > > > while a<10:
> > > > >     a=a+1
> > > > >     print a
> > > > >     print float(1/a)
> > > > >
> > > > > 输出:
> > > > > 2
> > > > > 0.0
> > > > > 3
> > > > > 0.0
> > > > > 4
> > > > > 0.0
> > > > > 5
> > > > > 0.0
> > > > > 6
> > > > > 0.0
> > > > > 7
> > > > > 0.0
> > > > > 8
> > > > > 0.0
> > > > > 9
> > > > > 0.0
> > > > > 10
> > > > > 0.0
> > > > >
> > > > > 如何让小数点后面有意义呢? 我的意思都看得懂吧? 正确的该怎么编呢?
> > > > >
> > > > >
> > > > > _______________________________________________
> > > > > 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
> > >
> >
> >
> > _______________________________________________
> > 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://python.cn/pipermail/python-chinese/attachments/20070627/89210ebd/attachment.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号