You are viewing a single comment's thread. Return to all comments →
Python 3
import re import sys string = sys.stdin.read() if bool(re.findall(r'\bdef\b|[^\.]print\b', string)): print("Python") elif bool(re.findall(r"\bpublic\s+class\b|\bpublic\s+static\s+void\s+main\b|\bSystem\.out\.println\b", string)): print('Java') elif bool(re.findall(r'\b#include\b|\bint\s+main\b|\bprintf\b', string)): print('C')
Seems like cookies are disabled on this browser, please enable them to open this website
Building a Smart IDE: Programming Language Detection
You are viewing a single comment's thread. Return to all comments →
Python 3