How to check if multiple variables are not none in Python

1 Answer

0 votes
a = 'python'
b = 'c++'
c = 13
d = True

if all(item is not None for item in [a, b, c, c]):
    print('All the variables are NOT none')
else:
    print('At least one of the variables is: none')



'''
run:

Multiple variables are

'''

 



answered Jul 28, 2022 by avibootz

Related questions

1 answer 111 views
1 answer 117 views
2 answers 144 views
1 answer 274 views
1 answer 159 views
...