Python论坛  - 讨论区

标题:[python-chinese] 结果是4L而不是4?

2006年12月28日 星期四 08:49

linda.s samrobertsmith在gmail.com
星期四 十二月 28 08:49:01 HKT 2006

小妹打了几行,很奇怪为什么w/q的结果是4L而不是4?
>>> q=2**1002
>>> w=2**1004
>>> w/q
4L

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

2006年12月28日 星期四 08:51

Hope lanyig在gmail.com
星期四 十二月 28 08:51:40 HKT 2006

大哥告诉你,参与运算的有一个是L,结果就是L.

2006/12/28, linda. s <samrobertsmith在gmail.com>:
>
> 小妹打了几行,很奇怪为什么w/q的结果是4L而不是4?
> >>> q=2**1002
> >>> w=2**1004
> >>> w/q
> 4L
> _______________________________________________
> 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/20061228/e2b55ceb/attachment.html 

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

2006年12月28日 星期四 09:35

linda.s samrobertsmith在gmail.com
星期四 十二月 28 09:35:07 HKT 2006

L是什么意思?对不起,基础很薄弱.

On 12/27/06, Hope <lanyig在gmail.com> wrote:
> 大哥告诉你,参与运算的有一个是L,结果就是L.
>
> 2006/12/28, linda. s <samrobertsmith在gmail.com>:
> >
> > 小妹打了几行,很奇怪为什么w/q的结果是4L而不是4?
> > >>> q=2**1002
> > >>> w=2**1004
> > >>> w/q
> > 4L
> > _______________________________________________
> > 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
>

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

2006年12月28日 星期四 09:39

shhgs shhgs.efhilt在gmail.com
星期四 十二月 28 09:39:01 HKT 2006

L表示Long

Python的int和long int可以自动转换。不过这种自动是单向的,也就是只能从int到Long

On 12/27/06, linda. s <samrobertsmith在gmail.com> wrote:
> L是什么意思?对不起,基础很薄弱.
>
> On 12/27/06, Hope <lanyig在gmail.com> wrote:
> > 大哥告诉你,参与运算的有一个是L,结果就是L.
> >
> > 2006/12/28, linda. s <samrobertsmith在gmail.com>:
> > >
> > > 小妹打了几行,很奇怪为什么w/q的结果是4L而不是4?
> > > >>> q=2**1002
> > > >>> w=2**1004
> > > >>> w/q
> > > 4L
> > > _______________________________________________
> > > 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

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

2006年12月28日 星期四 09:42

limodou limodou在gmail.com
星期四 十二月 28 09:42:22 HKT 2006

On 12/28/06, linda. s <samrobertsmith在gmail.com> wrote:
> L是什么意思?对不起,基础很薄弱.
>
long integer

-- 
I like python!
UliPad <>: http://wiki.woodpecker.org.cn/moin/UliPad
My Blog: http://www.donews.net/limodou

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

2006年12月28日 星期四 09:42

Hope lanyig在gmail.com
星期四 十二月 28 09:42:41 HKT 2006

这个基础的基础就不是mail list的用处了,你得自己去看书了.

2006/12/28, linda. s <samrobertsmith在gmail.com>:
>
> L是什么意思?对不起,基础很薄弱.
>
> On 12/27/06, Hope <lanyig在gmail.com> wrote:
> > 大哥告诉你,参与运算的有一个是L,结果就是L.
> >
> > 2006/12/28, linda. s <samrobertsmith在gmail.com>:
> > >
> > > 小妹打了几行,很奇怪为什么w/q的结果是4L而不是4?
> > > >>> q=2**1002
> > > >>> w=2**1004
> > > >>> w/q
> > > 4L
> > > _______________________________________________
> > > 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/20061228/3a05740e/attachment.htm 

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

2006年12月28日 星期四 09:51

刘星 liuxing在nanjing-fnst.com
星期四 十二月 28 09:51:28 HKT 2006

Integer literals with an "L" or "l" suffix yield long integers ("L" is preferred because "1l" looks too much like eleven!). 

这个在Python Library Reference的3. Built-in Types 的3.4 Numeric Types -- int, float, long, complex 里面有详细的讲解和说明。


--------------------------------------------------
Liu Xing
Development Dept.I
Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
8/F., Civil Defense Building, No.189 Guangzhou Road,
Nanjing, 210029, China
TEL: +86+25-86630566-836 
COINS: 79955-836 
FAX: +86+25-83317685
MAIL: liuxing在nanjing-fnst.com
--------------------------------------------------
  ----- Original Message ----- 
  From: Hope 
  To: python-chinese在lists.python.cn 
  Sent: Thursday, December 28, 2006 9:42 AM
  Subject: Re: [python-chinese] 结果是4L而不是4?


  这个基础的基础就不是mail list的用处了,你得自己去看书了.


  2006/12/28, linda. s <samrobertsmith在gmail.com>: 
    L是什么意思?对不起,基础很薄弱.

    On 12/27/06, Hope <lanyig在gmail.com> wrote: 
    > 大哥告诉你,参与运算的有一个是L,结果就是L.
    >
    > 2006/12/28, linda. s <samrobertsmith在gmail.com>:
    > >
    > > 小妹打了几行,很奇怪为什么w/q的结果是4L而不是4?
    > > >>> q=2**1002 
    > > >>> w=2**1004
    > > >>> w/q
    > > 4L
    > > _______________________________________________
    > > 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/20061228/87bc6388/attachment.html 

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

2006年12月28日 星期四 10:09

linuxbbs linuxbbs在163.com
星期四 十二月 28 10:09:27 HKT 2006

为啥不先去google一下或查查手册?

>小妹打了几行,很奇怪为什么w/q的结果是4L而不是4?
>> > > q=2**1002
>> > > w=2**1004
>> > > w/q
>4L

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

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

    你的回复:

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

    Zeuux © 2025

    京ICP备05028076号