●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'
SametAtdagThisdocumentcontains44questionsinthesesections:●Warmup-1●String-1●List-1●Logic-1Warmup-11.sleep_inTheparameterweekdayisTrueifitisaweekday,andtheparametervacationisTrueifweareonvacation.Wesleepinifitisnotaweekdayorwe'reonvacation.ReturnTrueifwesleepin.sleep_in(False,False)→Truesleep_in...
I’ve got a remark about the has12 function. It is stated “Given an array of ints, return true if there is a 1 in the array with a 2 somewhere later in the array. “. However, as you check the position of the last 1 and of the last 2, you do not take into account somethi...
Have fun with Python!Samet Atdag This document contains 44 questions in these sections:●Warmup-1 ●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 ...