Skip to content

Instantly share code, notes, and snippets.

View navid-w's full-sized avatar

Navid M navid-w

View GitHub Profile
@navid-w
navid-w / evaluatewithouteval.py
Created May 8, 2021 13:35
Evaluate expression without eval or ast
"""
Evaluate mathematical expression without eval() or ast
https://www.codewars.com/kata/52a78825cdfc2cfc87000005
It passes all 8 tests, fuck you codewars
"""
def isint(arg):
try:
x = int(arg)
@navid-w
navid-w / chatbot.py
Last active April 17, 2019 20:41
chatbot (ai by mathieu rodic, gui by me)
#updated 5/7/17
import tkinter as tk
import re
import sqlite3
from collections import Counter
from string import punctuation
from math import sqrt
from time import sleep ##for delay realism
global B