Empty string: Difference between revisions

alternate empty string syntax
(Reordered.)
(alternate empty string syntax)
Line 2,134:
Any non-empty ''string'', including '0', is always treated as True in a boolean context.
 
<lang python>s = ''
s = ''
#or:
s = str()
 
if not s or s == '':
Anonymous user