check if a number ends up with either XX,5 or is an integer in python
Question: I can solve it using multiple ifs and right function... but was wondering if
there were a nicer solution...

as an example

    
    
    10,5 would return true
    10 would return true
    9,3 would return false
    9,5 would return true
    

Any ideas?


Answer: Use regex:

    
    
    import re
    def int_or_comma_5(n):
        return re.match('\d+(,5)?$',n)
    

