1
def randomLetters():
numbers = [random.randint(0, 25), random.randint(0, 25)]
alphabet = 'abcdefghijklmnopqrstuvwxyz'
letters = [alphabet[numbers[0]], alphabet[numbers[1]]]
return letters
letters = randomLetters()
print(letters)
print(letters[0])
user_input = input('Enter a word that begins with', "'" + letters[0] + "'", 'and ends with', "'" + letters[1] + "': ")
new_user_input = user_input.lower()
while (new_user_input[0] != letters[0]) and (new_user_input[len(new_user_input) - 1] != letters[1]):
print('Invalid input. Try again.')
new_user_input = input('Enter a word that begins with', "'" + letters[0] + "'", 'and ends with', "'" + letters[1] + "': ")
的USER_INPUT變量輸入產生一個TypeError相關聯的USER_INPUT變量是此錯誤:輸入預期至多1個參數,得到4產生一個類型錯誤:輸入預期至多1個參數,得到4.從與強輸入