6 kyu
Float or Integer verifier
371 of 372Good O-man
Loading description...
Regular Expressions
Puzzles
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Python fork (author is inactive)
Value is not what was expected
tells almost nothing to the person solving the kata. The inputted value, what the user's function returned and what was expected should be given instead.Python:
arr
, even though it is a stringno random tests. (check my solution) :P
How this is integer
-3.2
: expacts TrueError messages were not that clear when submitting the solution. Argument name why "arr"??? Function name could be something more obvious, not that it was hard to understand but as a good standard.
This comment has been hidden.
Is there a way to show what numbers fail in the regex pattern? I tested my regex and 74 expression passed but 8 expression failed, I would like to know what numbers didn't pass the regex. I tested the regex and seems to look ok.
Print the input.
This comment has been hidden.
-> "I don't think there's a situation when 6.e+2 would count as a number..."
In python (at least) : 6.e+2 is the float 600.0, so this notation has to be considered as a number, actually.
What about leading and trailing zero which are ignored by try/float()/except solutions?
There should be a test with only one dot since some regexp solutions consider it a valid float.
I think, it should be mentioned somewhere that there should be no spaces in notation. Otherwise '- 12' should be considered as integer.
I'm having serious issues with rediting the kata for Ruby language: changes I make don't make it from the editor to the actual kata, are not saved... (looks like CodeWars platform issues to me). Anyway, seeing I can't make changes to the kata for Ruby lang, I just dropped it all together.
Hope the Python version is not acting funny.
This comment has been hidden.