Go Back   SEQanswers > Bioinformatics > Bioinformatics

Similar Threads
Thread Thread Starter Forum Replies Last Post
getopts in python bio_informatics Bioinformatics 3 05-02-2014 09:52 AM
HTSeq for python 3 schroedj Bioinformatics 0 07-15-2013 01:38 PM
Python marqudiego General 4 06-30-2013 10:14 PM
CummeRbund: Error in dat$fpkm + pseudocount : non-numeric argument to binary operator mebbert Bioinformatics 3 05-10-2013 02:09 PM
python dror Bioinformatics 0 11-29-2010 03:22 AM

Thread Tools
Old 01-09-2016, 03:42 AM   #1
Location: San Diego

Join Date: Sep 2013
Posts: 78
Default Python ternary operator Without Else

Dear All,

Is there a ternary operator without else in python

foo = "True" if test else "False"

is there a way

foo = "True" if test == 'True'

in python

Thanks so much in advance
AnushaC is offline   Reply With Quote
Old 01-09-2016, 08:57 AM   #2
Devon Ryan
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,480

That's the closest you get to a ternary operator in python.
dpryan is offline   Reply With Quote
Old 04-01-2016, 06:29 AM   #3
Junior Member
Location: Bochum, Germany

Join Date: Mar 2016
Posts: 2

What about:

if test: foo = True
MarkusP is offline   Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -8. The time now is 03:35 AM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO