●String-1 ●List-1 ●Logic-1 Warmup-1 1.sleep_in The parameter weekday is True if it is a weekday, and the parameter vacation is True if we are on vacation. We sleep in if it is not a weekday or we're on vacation. Return True if we sleep in.sleep_in(False, False) → ...
SametAtdag Thisdocumentcontains44questionsinthesesections: ● Warmup-1 ● String-1 ● List-1 ● Logic-1 Warmup-1 1.sleep_in TheparameterweekdayisTrueifitisaweekday,andtheparametervacationis Trueifweareonvacation.Wesleepinifitisnotaweekdayorwe'reonvacation. ReturnTrueifwesleepin. sleep_in(Fals...
comparing my answers of the Codingbat problems to yours and I have learnt quite a bit form your examples. However, here I have to agree with Frank. You solution on “has12” is flawed. To quote: “if there is A 1 in the array with a 2 somewhere later” specifies a single possible ...
●Warmup-2 ●Logic-2 ●String-2 ●List-2 Warmup-2 1.string_times Given a string and a non-negative int n, return a larger string that is n copies of the original string.string_times('Hi', 2) → 'HiHi'string_times('Hi', 3) → 'HiHiHi'string_times('Hi', 1) → 'Hi'