Share your repls and programming experiences

← Back to all posts

# Calculator App | Math Wiz

hi guys, i made a calculator app in django. It's not the usual calculator in the console, but in visuals. It can solve a lot though.

• instructions
• calculator

# Instructions

There is already an instructions link in the site, but here's a deeper instruction part.

when putting in problems in the area, it should be only numbers. Once you click enter, it gives the solution above.

2 + 2

output:

4

like that.

If you put letters, you will get a little message :)

# Feedback, and suggestions.

Upvotes, and suggestions would be appreciated.

Enjoy!

hotnewtop
RhinoRunner (693)

🔢 Calculator App | Math Wiz - Solves any problem 🔢

Guess it doesn't solve every problem...

@RhinoRunner you aren't supposed to put letters. Only nums.

BobTheTomatoPie (3355)

nice, but you should use latex to make the equations look cooler as you type them

BobTheTomatoPie (3355)

its a way to sort out an equation so that when you write things like 1/2 the 1 will be position over a line that is over the two, im sure you can find a tutorial on it @RYANTADIPARTHI

zaydi (7)

Yo good job and THREE LINES OF CODE G G
also how is there open in new tab but good job and also problem popper can do this too but looks a bit worse

@zaydi uh thanks! but, i don't get what you mean.

zaydi (7)

@RYANTADIPARTHI oh its just problem popper can only do some stuff like this

tussiez (1443)

Nice! As someone else as said, floats don't work, so you may need to round to a certain decimal point

RishabTirupath1 (0)

This is a very nice website! However, floats don't really work, as with any language, so you could work on that next.

CharlieS6289 (0)

Sorry to be annoying but can it solve algebra or is there a limit to the size of the problem because it couldn't solve the problem that I put in.

@CharlieS6289 hmm, i don't think it has a limit. I'm not sure though.

IntellectualGuy (662)

Can you make the calculator centered on the page?

DavidHilsee (2)

uhh exponents kinda dont work... sometimes the ^ symbol acts like a + and sometimes like a -

DavidHilsee (2)

nevermind, you just put ** instead of ^ @DavidHilsee

@DavidHilsee yes. That's what i was thinking.

DerpBurgerPlayz (0)

it cant even solve α0=0+α0=ax+(−ax)+a0=α(0+x)+(−αx)=αx+(−αx)=0...

DerpBurgerPlayz (0)

@DerpBurgerPlayz i can solve this in three seconds-
its −1(x)=−x

@DerpBurgerPlayz i figured out why it gets it wrong. Use ** instead of ^

TheCheeseCoder (64)

huh?

there's no main.py file apparently

[deleted]

Hey, @TheCheeseCoder, ru a cuber, ur google account profile is of a cube. If yes, even ima cuber! my 3x3 PB is 13.34.

@TheCheeseCoder hmm, it should be working. Try it now.

TheCheeseCoder (64)

Yes i am a cuber!

https://repl.it/teams/join/dhrmtvflgdkfkqmdvucxiptjoxoykkjr-NEoNcuberz

copy and paste it in the searchbar

[deleted]

WTF @TheCheeseCoder, the guy named @daksheshdorala has the same pb as mine! one in a million coincidence!

[deleted]

@TheCheeseCoder, I can help you in the among us game but I don't really know how to make a chat application which is in among us meetings.

Whippingdot (550)

IT DON'T WORK FOR ME...WHY...WHY DOESN'T ANYTHING WORK FOR ME. but really nothing works for me. Whenever I see a program it doesn't work...how unlucky am i?

Bookie0 (5951)

pretty cool, except like you can see with the above image, that is visibly wrong.

also you might want to change the title, we (rather I), I can't really see those characters.

Maybe instead of making the result appear on the top, you could put it directly on the text field like a real calc:

(where the yellow oval is)

and maybe a way to view your history! :D

@Bookie0 yeah, thanks for all those suggestions. But it the calculator shouldn't move to the right. It doesn't for anyone. Maybe it's server issue. Also, i'll try those side calculations.

Thanks!

Bookie0 (5951)

@RYANTADIPARTHI yea I think it's because I resized my window a bit, but still the result of a calculator normally should appear in the textbox! :)

@Bookie0 also, i figured out why it gets it wrong. Use ** instead of ^

Bookie0 (5951)

@RYANTADIPARTHI works well! You could maybe change so that it accepts ^ too as it’s used a lot! :)

FlaminHotValdez (431)

ur calculator is bad. it doesn't solve basic math equations properly 2^3-8*8^2+2^3+2 the output was -64, should be -494.

@FlaminHotValdez i figured out why it gets it wrong. Use ** instead of ^

FlaminHotValdez (431)

@FlaminHotValdez yeah. But in the coding world, it's **

FlaminHotValdez (431)

@RYANTADIPARTHI bruh...I looked at the code... you used EVAL?! legit anyone could do this if they know how to use django and html -_- at least TRY to integrate ^ for exponents instead of using the built-in python function...

FlaminHotValdez (431)

@RYANTADIPARTHI Only in Python. In C++, we have a power() function. Not to razz on you but this isn't really anything unique, the core is just the eval() function and everything else is basically django and html to make it pretty. Some people actually put a lot of effort into making calculator codes that aren't just eval(), me included. plz try to do this without eval, it's rly not anything special, it's an overdone idea that doesn't have anything unique.

@FlaminHotValdez ok. You don't know django. You don't know what can be done in django. So how can you say stuff like that? There are only a few ways. They are given like that. How you say, can't be done in django. PLease don't say these things if you don't know django.

FlaminHotValdez (431)

@RYANTADIPARTHI no, I'm not saying it can't be done in Django, I'm saying anyone that knows django and html can do this with the eval() function, but not everyone can think of a working algorithm to actually make a calculator.

@FlaminHotValdez no. It doesn't just take django either, it takes python too. you can't assume. Eval will be used most everywhere. no other way. But i will try it though.

FlaminHotValdez (431)

@RYANTADIPARTHI ...ok, thnx...my point is pretty much that there are less ppl that know how to make an app and use eval than ppl that can get a legit calculator algorithm, so as long as u know app development and python u can do it. there are not a lot of ppl that know how to make a legit calculator program. If u can't figure it out I made a code in C++ for a calculator program, it uses stack. https://repl.it/@FlaminHotValdez/Calculator

@FlaminHotValdez no problem. But one thing is, your code is like if statements. I didn't want to hard code it. I wanted every operator. Also, your repl doesn't work. IT gives an error.

FlaminHotValdez (431)

@RYANTADIPARTHI Ok, I fixed it. My program actually does do every operator, with PEMDAS too. The ifs are to determine the order of operations, that's why.

@FlaminHotValdez yeah, so that's kind of a hard code. I want to use every operator.

FlaminHotValdez (431)

@RYANTADIPARTHI yeah...but that's the only way to implement order of operations as far as I know, and I googled like 50 different pages and 20 different tutorials on youtube, so yeah.

FlaminHotValdez (431)

@RYANTADIPARTHI That being said though, it might be rather hard to do in Python due to the lack of a system stack.

[deleted]

Cool!

JosephSanthosh (1196)

not bad, stands out a lot from other calculators, good job