Extract Tens
Number places let you pull out individual digits without making the task complicated. Write a function tens_digit that takes a list of non-negative numbers nums. For each number, find its digit in the tens place and collect those digits in a new list.
Примеры
Ввод
[12, 5, 234]Вывод
[1, 0, 3]Ввод
[3, 4, 5]Вывод
[0, 0, 0]Ввод
[20, 99, 100]Вывод
[2, 9, 0]Нужно реализовать
def tens_digit(nums: list[int]) -> list[int]:
Теги
listsarraymath
Συνδεθείτε για να δείτε το ιστορικό υποβολών
ΣύνδεσηΣυνδεθείτε για να χρησιμοποιήσετε τον AI Mentor
ΣύνδεσηVisible tests
1
Input
[12,5,234]Expected
[1,0,3]2
Input
[3,4,5]Expected
[0,0,0]3
Input
[20,99,100]Expected
[2,9,0]4
Input
[]Expected
[]5
Input
[10]Expected
[1]6
Input
[12,5,234,12]Expected
[1,0,3,1]Focus radio
Paused · SomaFM · Fluid