Respuesta :
Answer:
The following are the program in the Python Programming Language.
#define method
def listBuilder(l1,length):
#declare list type variable
lst=[];
#set the for loop
for i in l1:
#check that the length of 'i' is greater than 'length'
if(len(i)>=length):
#append the value of in the list
lst.append(i);
return lst
#declare list type variable and initialize the value in it.
lst=["Hello","i","am","Python"]
#call method and pass arguments in it
print(listBuilder(lst,4))
Output:
['Hello', 'Python']
Explanation:
The following are the description of the program.
- Define a function 'listBuilder()' and pass arguments 'l1' and 'length'.
- Declare the empty list type variable 'lst'.
- Set the for loop in which we set the if conditional statement to check the length of the variable 'i' is greater and equal to the variable 'length' then, append the value of the variable 'i' in the list and return the list.
- Finally, we set the list type variable outside the function and pass value in it and call and print the following function.