Advertisement
dprincef

Untitled

Feb 28th, 2020
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. def right_word(list, number): #Declares a right_word function
  2.     m = [] #Creates an empty list
  3.     for j in list: #Implementation of a loop that scans through the list and checks if the length of one or more element is equal to the number inputted and then stores it into the empty list already created
  4.         if len(j) == number:
  5.  
  6.             m.append(j)
  7.     print(m) #Prints the new appended list
  8. right_word(["folake","femi", "bose","fola"],4)   #Calls the right_word function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement