YUX
V2EX  ›  问与答

Python 里的 if f(x) and g(x): 这句, 若 f(x)为 False,还会计算 g(x)么?

  •  
  •   YUX ·
    PRO
    · Mar 28, 2020 · 1186 views
    This topic created in 2326 days ago, the information mentioned may be changed or developed.

    如果 python 里的 if f(x) and g(x): 这句, 若 f(x)为 False,还会计算 g(x)么?

    Trim21
        1
    Trim21  
       Mar 28, 2020
    python -c '0 and print(233)'
    不会
    jingniao
        2
    jingniao  
       Mar 28, 2020 via iPhone
    哪个语言 or and 是计算全部?
    Muninn
        3
    Muninn  
       Mar 28, 2020
    我会的语言都不会
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5959 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 02:29 · PVG 10:29 · LAX 19:29 · JFK 22:29
    ♥ Do have faith in what you're doing.