What Will This Print?

Discussion in 'NZ Computing' started by Lawrence D'Oliveiro, Nov 11, 2009.

  1. There are very few gotchas in Python: this is one of them. What output will
    the following sequence produce?

    def append(l, tolist = []) :
    tolist += [l]
    return tolist
    #end append
    print(append(3))
    print(append(4))
     
    Lawrence D'Oliveiro, Nov 11, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?cGVjaw==?=

    Can't print to print server

    =?Utf-8?B?cGVjaw==?=, Feb 2, 2005, in forum: Wireless Networking
    Replies:
    2
    Views:
    685
    =?Utf-8?B?cGVjaw==?=
    Feb 3, 2005
  2. =?Utf-8?B?enljZ3M=?=
    Replies:
    1
    Views:
    554
    Daz N
    Jan 4, 2005
  3. epl

    Print sharing -- why can't I print?

    epl, Sep 14, 2003, in forum: Computer Support
    Replies:
    1
    Views:
    438
  4. vddiee
    Replies:
    2
    Views:
    2,862
    vddiee
    Jul 16, 2004
  5. Bun Mui
    Replies:
    3
    Views:
    846
    Phantom
    Sep 13, 2004
Loading...

Share This Page