Off Topic > Off Topic
Programming Megathread
Foxscotch:
--- Quote from: Timestamp on October 29, 2016, 11:41:15 AM ---oh sure
i'll go ahead and pm one to you if you want
--- End quote ---
you might as well just post it here. there's no reason for the challenge alone to be private, and that way you can have other people help, and some people could even try to solve it themselves
Timestamp:
sure then
i'm having a bit of a problem with this kata:
--- Code: ---In this kata you get the start number and the end number of a region and should return the count of all numbers except numbers with a 5 in it. The start and the end number are both inclusive!
Examples:
1,9 -> 1,2,3,4,6,7,8,9 -> Result 8
4,17 -> 4,6,7,8,9,10,11,12,13,14,16,17 -> Result 12
The result may contain fives. ;-)
The start number will always be smaller than the end number. Both numbers can be also negative!
--- End code ---
i was thinking about something like making a list such as this:
--- Code: ---def dont_give_me_five(start,end):
n = []
if n == 5:
n.remove()
return n # amount of numbers
--- End code ---
i'm guessing it's not entirely correct but that's what i did try\
you could say i got some idea, but the execution is bad lol
Headcrab Zombie:
It says remove all numbers with a five in it, not just five
So 15, 25, 52, etc
You'll want a for loop for each number n between start and end,
if n does not contain 5, increment a counter
Timestamp:
--- Quote from: Headcrab Zombie on October 29, 2016, 01:35:12 PM ---It says remove all numbers with a five in it, not just five
So 15, 25, 52, etc
You'll want a for loop for each number n between start and end,
if n does not contain 5, increment a counter
--- End quote ---
ahh, thanks
Metario:
ATM at the ACM event at university of Utah
Warnock (UofU) is in the lead finishing 6, failing on 1