Task 2. The houses on a street are numbered from 1 to 100. How many times does the digit $7$ appear in the house numbers?
Solution. The house numbers that contain the digit 7 are: 7, 17, 27, 37, 47, 57, 67, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 87, 97. In these numbers, it appears a total of 20 times (twice in the number 77).