Python Forum
is this a bug or not with if...else...?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
is this a bug or not with if...else...?
#4
@Larz60+ You forgot a + in the reversed version, and you cannot inverse the assignment statement. The reversed version is
a=None; b='abc'; c = a + ' & ' + b if a != None else b
and it also works.
Reply


Messages In This Thread
is this a bug or not with if...else...? - by meokey - Sep-02-2018, 09:29 PM
RE: is this a bug or not with if...else...? - by Gribouillis - Sep-03-2018, 04:05 AM

Forum Jump:

User Panel Messages

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