Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
gotcha
#5
(Feb-21-2017, 04:50 PM)micseydel Wrote: I can see how this is somewhat surprising but it does seem consistent
Output:
>>> True + True + False + True 3

There is also the alternative to x=value_if_true if some_boolean else value_if_false: x=[value_if_false,value_if_true][some_boolean]
Unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.
Your one-stop place for all your GIMP needs: gimp-forum.net
Reply


Messages In This Thread
gotcha - by Skaperen - Feb-21-2017, 09:14 AM
RE: gotcha - by Larz60+ - Feb-21-2017, 10:12 AM
RE: gotcha - by zivoni - Feb-21-2017, 10:46 AM
RE: gotcha - by micseydel - Feb-21-2017, 04:50 PM
RE: gotcha - by Ofnuts - Feb-21-2017, 09:30 PM
RE: gotcha - by micseydel - Feb-21-2017, 09:33 PM
gotcha 2.0 - by Skaperen - Feb-22-2017, 02:28 AM
RE: gotcha - by ichabod801 - Feb-22-2017, 02:34 AM
RE: gotcha - by Skaperen - Feb-22-2017, 05:16 AM
RE: gotcha - by micseydel - Feb-22-2017, 04:59 AM

Forum Jump:

User Panel Messages

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