Can anyone tell why am not able to paas the test "That's odd'? | Sololearn: Learn to code for FREE!


Can anyone tell why am not able to paas the test "That's odd'?

5/28/2022 3:54:46 PM


7 Answers

New Answer


Avi Also continue is use to skip current iteration on the basis of True or False So using continue in else part not making any sense because when if condition will satisfy then only if block will execute otherwise nothing will happen, so only doing this: if True or False: #statement is enough if you want to actually use continue then do this: #this will skip to add odd items if items % 2 == 1: continue b = b + items -------------- a = int(input()) b = 0 for i in range(a): n = int(input()) if n % 2 == 1: continue b = b + n print (b)


Hello Avi You don't get a string. So l = input().split() will not work. #at first you get the length length = int(input()) #then you get some numbers for i in range(length): n = int(input()) #now you can check if n is even or not and sum it


What is the task? Please mention course name and task number.


Thanks Denise Roßberg ✌️


Avi Just copy the code and put in that task, then tell me it is giving right answer or not.


Lisa it's the question from code coach (That's Odd') I think it's not able to paas test case bcz the all inputs are in new lines what do I do to take ∞ inputs in new lines...?


A͢J thanks bro but using continue in if loop and then updating value of b after that will not gonna give right can remove continue and thanks for help🙂✌️