I am using BeautifulSoup and parsing some HTMLs.
I\'m getting a certain data from each HTML (using for loop) and adding that data to a cert
For anyone interested in a shorter way:
gotdata = len(dlist)>1 and dlist[1] or 'null'
But for best performance, I suggest using False instead of 'null', then a one line test will suffice:
False
'null'
gotdata = len(dlist)>1 and dlist[1]