Value in the List
Write a function check that takes a list seq and a value elem. Return True if elem is in the list; otherwise return False. For an empty list, return False as well. The in operator will help — it checks whether a value is in a list.
Примеры
Ввод
[66, 101], 66Вывод
TrueВвод
[78, 117, 110, 99, 104, 117, 107, 115], 100Вывод
FalseВвод
["t", "e", "s", "t"], "e"Вывод
TrueНужно реализовать
def check(seq: list, elem) -> bool:
Теги
listsarray
Logáil isteach chun stair na n-aighneachtaí a fheiceáil
Logáil isteachLogáil isteach chun an Meantóir IS a úsáid
Logáil isteachTests12
Visible tests
Tástáil fholaithe 7
Tástáil fholaithe 8
Tástáil fholaithe 9
Tástáil fholaithe 10
Tástáil fholaithe 11
Tástáil fholaithe 12
They run when you press "Submit" — your whole solution is checked against them so you can't hard-code answers for the visible cases.
Focus radio
Paused · SomaFM · Fluid