Two or Three
This is a simple check for whether a short list contains one of the values you care about. Write a function has23 that takes a list nums with exactly 2 numbers. Return True if at least one element is 2 or 3, otherwise return False.
Примеры
Ввод
[2, 5]Вывод
TrueВвод
[4, 3]Вывод
TrueВвод
[4, 5]Вывод
FalseНужно реализовать
def has23(nums: list[int]) -> bool:
Теги
listsarray
Jelentkezz be a beküldési előzmények megtekintéséhez
BejelentkezésJelentkezz be az MI-mentor használatához
BejelentkezésVisible tests
1
Input
[2,5]Expected
True2
Input
[4,3]Expected
True3
Input
[4,5]Expected
False4
Input
[2,3]Expected
True5
Input
[1,1]Expected
False6
Input
[2,2]Expected
TrueFocus radio
Paused · SomaFM · Fluid