I am trying to create a function that takes two words and returns them if conditions are met. Word 1 has to be a certain number of characters, word 2 has to begin with a certain letter. I can get it to work with one condition but am confused when I have to meet two. This is what I have so far. Example below
Enter a 4 letter word: two
Enter a 4 letter word: wall
Enter a word starting with B: apple
Enter a word starting with B: boxes
['wall', 'boxes']
def twoWords(lenLet, strtLet):
input1 = str(input("Enter a word that is 4 letters long: "))
while len(input1) != 4:
input1 = str(input("Enter a word that is 4 letters long: "))
if len(input1) == 4:
break
input2 = str(input("Enter a word that begins with b: "))
while firstletter(input2) != 'b' or 'B':
input2 = str(input("Enter a word that begins with b: "))
if firstletter(input2) == 'b' or 'B':
break
return input1 and input2
print(twoWords()