5 Ways to Check if a List is Empty in Python (TUTORIAL)

preview_player
Показать описание
Python tutorial on how to check if a list is empty.

Learn how to evaluate the truthy/falsy nature ("implicit booleanness") of lists and empty lists in Python.

❗❗This video is part of a SERIES. Check out the other videos below ❗❗

💻 Python List Comprehensions Course Playlist:

💻 Python Interview Questions Playlist:

📖 The complete Udemy course on Python Built-in Functions:

💻 Python any() built-in function video:

💻 Python isinstance() built-in function video:

📚 Stack Overflow Question:

📚 PEP Python Documentation:

⚙️ Recommended Computer Gear:

✈️ Recommended Digital Nomad Gear:
Рекомендации по теме
Комментарии
Автор

Your explanations and voice are so relaxing. Thanks for the breakdown! Used it to teach someone else Python

officiallyjk
Автор

Very helpful and informative! Thanks for the breakdown and reasoning behind each solution

cpebud
Автор

Could you write the code that uses a list containing three characters and then asks a user to enter a character. The code will then search the list to see if the entered character is in the list or not. If it’s not in the list, then the user is asked to enter a different character. This loop keeps repeating until the user enters a character which IS present in the list.

mcdonaldifill
Автор

i used .... if list1 != [ ]: (inside of my while loop) :D thanks!!!!

LiverpoolDon
Автор

Wish someone could have explained it in more plan English how to interpret the first solution which says " if not list1 ". I am new to python & was practising one of this exercise & I couldn't interpret this line that says if not list1, I mean if I am checking the length of the list I can still understand what I am trying to do with. this line goes above my head. It would have been good if you can read the statements in plain English to make a beginner understand this who has no programming background.

subhashsansarwal