Python Forum
Simple code question about lambda and tuples
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple code question about lambda and tuples
#3
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 strange way to write that predicate - it would be easier to read written as x != 0, obviously.
JasPyt likes this post
Reply


Messages In This Thread
RE: Simple code question about lambda and tuples - by ndc85430 - Oct-03-2021, 02:35 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Very Beginner question on simple variables Harvy 1 234 Apr-12-2024, 12:03 AM
Last Post: deanhystad
  Help with simple code JacobSkinner 1 368 Mar-18-2024, 08:08 PM
Last Post: deanhystad
  I have a code which is very simple but still I cannot detect what's wrong with it max22 1 516 Nov-07-2023, 04:32 PM
Last Post: snippsat
  Simple Question - ' defined as "a". ?' Ryan012 10 1,711 May-27-2023, 06:03 PM
Last Post: Ryan012
  Very simple question about filenames and backslashes! garynewport 4 2,031 Jan-17-2023, 05:02 AM
Last Post: deanhystad
  Python Tkinter Simple Multithreading Question AaronCatolico1 5 1,663 Dec-14-2022, 11:35 PM
Last Post: deanhystad
  help me simple code result min and max number abrahimusmaximus 2 962 Nov-12-2022, 07:52 AM
Last Post: buran
  A simple "If...Else" question from a beginner Serena2022 6 1,800 Jul-11-2022, 05:59 AM
Last Post: Serena2022
  Simple encoding code ebolisa 3 1,493 Jun-18-2022, 10:59 AM
Last Post: deanhystad
  How would you (as an python expert) make this code more efficient/simple coder_sw99 3 1,840 Feb-21-2022, 10:52 AM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

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