dharmik
@dharmik@linuxusers.in
dharmik » 2024-11-10@dharmik@linuxusers.in
thisislist = ["apple", "banana", "cherry", "kiwi", "mango"]new_list = [i for i in thisislist if "a" in i]print(new_list)
thisislist = ["apple", "banana", "cherry", "kiwi", "mango"]
new_list = [i for i in thisislist if "a" in i]
print(new_list)
Drew » 2024-11-10@crmsnbleyd@hachyderm.io
@dharmik welcome to one of the funnest part of python
@dharmik there's set and dict comprehensions as well
arialdo » 2024-11-26 / 2024-11-26@arialdo@mastodon.online
@dharmik wait to realize that list comprehensions are syntactic sugar for monads…
dharmik » 2024-11-27 / 2024-11-27@dharmik@linuxusers.in
History