“python se não for nulo ou vazio” Respostas de código

Verifique se a string está vazia python

my_str = ""
if not my_str:
  print("empty")
else:
  print("not empty")
#output: empty
Doubtful Dingo

python se não for nulo ou vazio

#check is not null
if var is not None:
    print('Var is not null')
Itchy Ibex

python se não for nulo

strtest = "xxxxxx"

if strtest is not None:
  print("strtest is not None")
dr4ft

Respostas semelhantes a “python se não for nulo ou vazio”

Perguntas semelhantes a “python se não for nulo ou vazio”

Procure respostas de código populares por idioma

Procurar outros idiomas de código