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.
@weijin96
post code below and I'll have a look for you.@ankitom
You are receiving this error because you are casting an empty string to an integer. Your variablenum
doesn't get appended to and remains and empty string; therefore when you cast it to an integer, you receive an error.1.) If there is an empty string, you must return "1" (string) not 1 (integer). You fail for an empty string: "" -> 1 (expected "1").
2.) If there isn't an integer at the end of the string, you have to put "1" at the end of the string. Your code receives an error because
num
is not appended to and you get an error. You have to add a "1" at the end of the string, since there isn't a number.3.) Your code fails when
string="foobar00"
because your code doesn't check zeros, so num has been appended to and therefore it tries to cast an empty string.Im having the same problem and i still dont understand the issue even after using print() because i dont think im casting an empty string
This comment is hidden because it contains spoiler information about the solution