We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Day 16: Exceptions - String to Integer
Day 16: Exceptions - String to Integer
Sort by
recency
|
1012 Discussions
|
Please Login in order to post a comment
If you get this in your Python 3 code test: Compiler Message: Error reading result file.You should use exception handling concepts
then remove this line and test again:
I also stucked in loop to testmy code everywhere, even GPT says my code is correct. I go through discussions and saw same probloem with a guy and tested without that block, I was shocked, my code is now works well and ready for submission.
My JS solution:
string S = Console.ReadLine();
Console.WriteLine(S.Any(c=> !(c >= 48 && c <= 57) || c==' ')?"Bad String":S);
Console.WriteLine(Int32.TryParse(S, out int result)?result:"Bad String");
I'm using swift, and getting the same error over and over, did anyone knows how to solve it?
this is meu received error: Compiler Message Error reading result file.You should use exception handling concepts.
and this is my working code:
I had to remove the "if name == 'main':"