Share your repls and programming experiences

← Back to all posts
Calculator with up to 5 numbers
Sreshthangsu (6)

Yeah! it is a great code but if u are a beginner I don't no if u are but if u are then u should not write a complex code and if u are a beginner u cannot even make such complex code again if u are a beginner u have copied it from yt but if u are not a beginner u can make it or not depends on how great u learned coding urself I am giving u a link of mine just with 2 digits and it is a much easier code as I am kinda more a beginner but not a full beginner
check my code:

GracieKing (39)

@Sreshthangsu i made this two years ago... i didn't copy it from yt, i did it in class. the code is by me. also your calculator is really good :)


@Sreshthangsu I don't know what exactly you were trying to say, but I'll assume you meant that it's not possible to write complex code for a beginner.

Although this is a good effort at creating a calculator, the number of if statements is really unnecessary, this doesn't determine complexity. And this is only a calculator with 5 numbers, I don't know how long the code will be if it was implemented for 100 numbers.

You should try to shorten your code as much as possible while also keeping it readable. Now mines is a really bad example of readability since I wrote it on the spot, but here it is.

It can take in n inputs and you can use any operator you want on them.

XanthusPettitt (7)

cool! also love the name "Gracie's amazing calculator of cats and unicorns"

Sreshthangsu (6)

@GracieKing i get it and I am actually a 9year old and I will add random to my calculator