39.0k views
5 votes
define a function remove lies that consumes a list of boolean values and produces a new list without any of the false values

1 Answer

5 votes

Answer:

lst=[True,False,True]

def remove_lies(a_list):

truth=[]

for i in range(len(a_list)):

if a_list[i]== False:

a_list[i]=True

return a_list

print(remove_lies(lst))

Step-by-step explanation:

Used other online resources to figure out this one. Was working on it myself and got stuck.

User Sahil Doshi
by
3.9k points