Skip to content

Commit 445e985

Browse files
Add "empty list" validation(check) to list.py (#135)
* Add "empty list" validation(check) to list.py * Update list.py --------- Co-authored-by: Samuel Huang <[email protected]>
1 parent 9fd8084 commit 445e985

File tree

1 file changed

+7
-0
lines changed
  • ultimatepython/data_structures

1 file changed

+7
-0
lines changed

ultimatepython/data_structures/list.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ def main():
9292
numbers.sort()
9393
assert numbers == [1, 2, 3, 4, 5]
9494

95+
# Let's check if these lists are empty
96+
assert len(numbers) == 5
97+
empty_list = []
98+
assert len(empty_list) == 0
99+
assert not empty_list
100+
assert len([None]) == 1
101+
95102

96103
if __name__ == "__main__":
97104
main()

0 commit comments

Comments
 (0)