python short conditional?

  • Thread starter Pieter Claassen
  • Start date
P

Pieter Claassen

I am looking to find a short conditional for python equivalent
to the perl question mark operator

statement? if true:else false

Any recommendations on this?

Pieter
 
R

Roy Smith

Pieter Claassen said:
I am looking to find a short conditional for python equivalent
to the perl question mark operator

statement? if true:else false

There is no such ternary operator in Python. There was a HUGE debate
earlier this year about possibly adding it. To make a very long story
short, it's not going to happen. Look up PEP-308 for more details.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,102
Messages
2,570,645
Members
47,243
Latest member
CorrineCad

Latest Threads

Top