Empty string: Difference between revisions

Content deleted Content added
Added Robotic implementation to Empty string
Line 2,029: Line 2,029:
The empty string is printed by Python REPL as <nowiki>''</nowiki>, and is treated as boolean false (as are most empty container types, by convention). Any non-empty ''string'', including '0', is always treated as True in a boolean context.
The empty string is printed by Python REPL as <nowiki>''</nowiki>, and is treated as boolean false (as are most empty container types, by convention). Any non-empty ''string'', including '0', is always treated as True in a boolean context.
<lang python>s = ''
<lang python>s = ''
if not s:
if len(s) == 0:
print('String s is empty.')
print("String is empty")
else:
if s:
print('String s is not empty.')</lang>
print("String not empty")


=={{header|R}}==
=={{header|R}}==