+ 4
Whereâs the mistake?
Trying to complete the practice but while submitting system says thereâs invalid syntax in the 7th line (print). But I donât understand whatâs the mistake. Could you help me please? names = ["David", "John", "Annabelle", "Johnathan", "Veronica"] #your code goes here long_name = list(filter(lambda x:len(x)> 5, names) print(long_name)
5 Answers
+ 5
You forgot a parenthese to close your list() function
+ 2
np!
+ 1
Isak Nilsson, thank you very much!:)
+ 1
Faster code execution using List Comprehension Approach
names = ["David", "John", "Annabelle", "Johnathan", "Veronica"]
long_name = [i for i in names if len(i) > 5]
print(long_name)
0
iTech, yes, thank you for the suggestion:)
In this practice they wanted for user to practice filters and lambdas