V
volcs0
I've done this in Scheme, but I'm not sure I can in Python.
I want the equivalent of this:
if a == "yes":
answer = "go ahead"
else:
answer = "stop"
in this more compact form:
a = (if a == "yes": "go ahead": "stop")
is there such a form in Python? I tried playing around with lambda
expressions, but I couldn't quite get it to work right.
I want the equivalent of this:
if a == "yes":
answer = "go ahead"
else:
answer = "stop"
in this more compact form:
a = (if a == "yes": "go ahead": "stop")
is there such a form in Python? I tried playing around with lambda
expressions, but I couldn't quite get it to work right.