mogermany's blog

By mogermany, history, 3 months ago, In English

Hi everbody I have a problem with a codefoeces task called "Even Odds" 318A - Even Odds with python My code do not work with the test number 8

that is my code

def create(n,k):

numbers=[]

i = 1

o = 1

while i <= n:

if i%2 != 0:

numbers.append(i)

i+=1

while o <= n:

if o%2 == 0:

numbers.append(o)

o+=1

return numbers[k]

####

n, k = map(int, input().split())

print(create(n, k-1))

Can u help me please ?

Read more »

 
 
 
 
  • Vote: I like it
  • -1
  • Vote: I do not like it

By mogermany, history, 3 months ago, In English

Hi how are you ? I am Mo and I am looking for new friends, that interests for IT Do you want text with me about out Experience in IT ? Then text me back :)

Read more »

 
 
 
 
  • Vote: I like it
  • -22
  • Vote: I do not like it