May-12-2019, 04:12 PM
A space is still a character so not the same as an empty string,
use the string method
use the string method
strip
to remove leading and trailing white space.print('' == ' '.strip()) print('' == ' '.strip()) print('' == ' test '.strip())
Output:True
True
False