Skip to content

Instantly share code, notes, and snippets.

View MuhammedAnasm4444's full-sized avatar

Muhammed Anas MuhammedAnasm4444

View GitHub Profile
@MuhammedAnasm4444
MuhammedAnasm4444 / calc.py
Last active August 16, 2020 11:20
Calculator in Python without using eval()
# Take inputs from user as list
# Then apply this loop
# for example user input is (1+2-3)
# the list is = ['1','+','2','-','3']
# it check the opperands in list[2] and do the operation b/w list[1] and list[3] and pops all first three elements in
# list add the new value in list[1] and operation goes on ......
for i in range(len(value)):
try: