I made a calculator in python without importing 'math' or using 'eval'

On the first line, type your first number, on the second line, type your operator, on the third line, type the second number, and on the fourth line, type "=" and press enter.

The syntax should look like this:

The operators are:

"+" for addition

"-" for subtraction

"*" or "x" for multiplication

"/" for division

"^" or "**" for exponents

"//" or "/*" for roots (example: 8 // 3 is the cube root of 8.)

"," for fractions (example: 2 , 3 is the fraction 2/3.)

You are viewing a single comment. View All

maybe you should make it so that you can have mixed operations and not only 2 numbers and a gui using tkinter.


@ApoorvAgrawal Thanks for the idea. The code for this project is broken and my efforts to fix it are going nowhere, so I might delete this post later on, considering that it links to a repl that doesn't work.


how doesn't it work, it works for me


@ApoorvAgrawal The divide function multiplies instead


@ApoorvAgrawal like this