September
ABC 373Problem 43 of 50
EasyWhat to do
You have 12 words, and each word is numbered from 1 to 12. Your task is to count how many words have a length that matches their number (for example, the first word should have 1 letter, the second word should have 2 letters, and so on).
Key Concepts
loops
if-statements
basic string manipulation
counting
Examples
Input:
'january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'
Output:
1
Input:
've', 'inrtfa', 'npccxva', 'djiq', 'lmbkktngaovl', 'mlfiv', 'fmbvcmuxuwggfq', 'qgmtwxmb', 'jii', 'ts', 'bfxrvs', 'eqvy'
Output:
2
Tips for Beginners
- Focus on understanding the logic, not memorizing syntax
- Use print statements to debug your code
- Don't worry about input parsing - the function handles that for you
- If stuck, try writing out your solution on paper first
Python Editor
Loading Python...