Your code should be as long as it needs to work in my opinion. Granted, I’m no expert, but for something like this, I think having a functional calculator is more important than how elegant or short you can make your code. Of course terse and efficient code is probably important in large projects, but I think you’re fine at this point if your code is a little longer. You can always improve it as you learn more.
Sorry I can’t give more specific advice at the moment. Code is difficult to read on a phone screen
Note: More experienced people please correct anything I might have said incorrectly here!