Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Simple code question about lambda and tuples
Post: RE: Simple code question about lambda and tuples

(Oct-03-2021, 07:02 PM)buran Wrote: (Oct-03-2021, 04:50 PM)JasPyt Wrote: 2-0 and 1-1 which is: True and True => gives TrueOutput:>>> 2-0 and 1-1 00 is False but I guess you mean Outp...
JasPyt General Coding Help 7 3,353 Oct-04-2021, 04:20 PM
    Thread: Simple code question about lambda and tuples
Post: RE: Simple code question about lambda and tuples

(Oct-03-2021, 02:35 PM)ndc85430 Wrote: Remember that 0 is treated as false when it is tested for its truth value (see the docs), so x - 0 will evaluate to True for any value that isn't 0. It's a str...
JasPyt General Coding Help 7 3,353 Oct-03-2021, 04:50 PM
    Thread: Simple code question about lambda and tuples
Post: Simple code question about lambda and tuples

I have a simple code: my_tuple = (0,1,2,3,4,5,6) foo = list(filter(lambda x: x-0, my_tuple)) print(foo)I know what the output is and that it removes the first entry, the 0. I could also change it as...
JasPyt General Coding Help 7 3,353 Oct-03-2021, 01:51 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020