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
word_list = [] count = 0
for i in range(10): word = input("Enter a word: ") word_list.append(word)
for word in word_list: if word.startswith('a'): count += 1
print("Number of words starting with 'a':", count)