Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I went with the if statement but when I went to grab the index I was getting '0'. This is true because once needle is found, needle was all I had to work with. You are close but lose the if statement.
I am new to cpp. Would you like to explain, how the code works.
Mark your post as having spoiler content when it does and use proper markdown
Find how to put a var value in a string in Python (there is more than one way), what you did won't work.
This comment is hidden because it contains spoiler information about the solution
Because you're calling
int("")
.Issue
's are kata-related, If your code is not working correctly, usequestion
tag instead.Output is showing error:
Traceback (most recent call last):
File "main.py", line 3, in
Test.assert_equals(iq_test("2 4 7 8 10"),3)
File "/home/codewarrior/solution.py", line 9, in iq_test
i = int(i)
ValueError: invalid literal for int() with base 10: ''
But my code works fine in IDE. Why it is showing ValueError?
Issue solved! Thanks!
Probably you're printing the result instead of returning it.
why does the output show: None should equal ['Ryan', 'Mark'], though my code seem to be worked well in IDE.