HackerRank Language

  • + 0 comments

    Python 3

    import re
    pattern = r'^\d{5}\s(C|CPP|JAVA|PYTHON|PERL|PHP|RUBY|CSHARP|HASKELL|CLOJURE|BASH|SCALA|ERLANG|CLISP|LUA|BRAINFUCK|JAVASCRIPT|GO|D|OCAML|R|PASCAL|SBCL|DART|GROOVY|OBJECTIVEC)$'
    for _ in range(int(input())):
        print('VALID' if bool(re.match(pattern, input())) else "INVALID")