gpt-3.5-turbo-0613· OpenAI
WildChat-4.8M (AI2)
Write a program that reads from the user 10 words. The program then should count and…
- User
Write a program that reads from the user 10 words. The program then should count and print the number of words that start with character 'a
- Assistant
words = [] count = 0
for i in range(10): word = input("Enter a word: ") words.append(word)
if word.startswith('a'): count += 1print("Number of words that start with 'a':", count)