Repeat-2
A MathWikiből
A lap korábbi változatát látod, amilyen Imran (vitalap | szerkesztései) 2021. április 30., 07:44-kor történt szerkesztése után volt.
Problem 1 (2.5 point):
Write a search() function, which first parameter is an x and after that it can have arbitrary many named parameters. (search(x, **kwargs)) The function should return True, if there exist a key in kwargs, for which the corresponding value is x. Otherwise it should return False.
Examples:
search(2, a=1, b=3) -> False search(2, a=1, b=3, c=2) -> True
Problem 2 (3.5 point):
Write a variadic increasing() function, which inputs are arbitrary many positive natural numbers, and it returns True if the sequence of the numbers contains an increasing subsequence of length 3.
Examples:
increasing(1, 2, 1, 2, 4) -> True increasing(1, 2, 1, 2, 1) -> False