Value in the List
Checking whether a value is present comes up all the time, like seeing if an item is in a cart or a user is in a list. Write check, which takes a list seq and a value elem. Return True if the value appears in the list; otherwise return False.
Примеры
Ввод
[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 isteachVisible tests
1
Input
[66,101], 66Expected
True2
Input
[78,117,110,99,104,117,107,115], 100Expected
False3
Input
["t","e","s","t"], "e"Expected
True4
Input
["what","a","great","kata"], "kat"Expected
False5
Input
[1,2,3,4,5,6,7,8,9,0], 0Expected
True6
Input
["WHAT","A","GREAT","KATA"], "kat"Expected
FalseFocus radio
Paused · SomaFM · Fluid