Answers for "how to check null string in python"

3

how to check empty string in python

my_empty_string = ''  # given the empty string a variable

def check_empty():
    if not my_empty_string: 
        print("Empty")
    else:
        print("Not Empty")


check_empty()



# by George Kwabena
Posted by: Guest on September-01-2020
0

python if null

noneObj = type(None)()
print(NoneObj)
// Check if NoneObj is instance of NoneType class
print(NoneObj is None)

//If-Else example
if (error is not None):
	result = error.decode()
else:
	result = "Hurray ^_^"

print(result)
Posted by: Guest on August-06-2021

Code answers related to "how to check null string in python"

Python Answers by Framework

Browse Popular Code Answers by Language