If/Else/Elif not working

I was trying to create a calculator in python, but it is not working. Whenever I try to calculate the mean, it throws up a divide by zero error. Here is the link to my code: Data Set Calculator | Replit If there is anything I need to change or ways I could make it better, please let me know.

Hey @ResistingGuide4, welcome to the community!

Imma be honest that code is completely unreadable, I didn’t even know you could use match && case in python :skull:

I added a lot of comments. Hopefully that helped.

Also, if you are familiar with js, it is just like a switch statement.

You need to do a while loop while newNum != “Done” also do this: newNum == "Done" or newNum == "done"

I did that, but now it doesn’t pick up when I say done. BTW, this is my first python program. I know js, but I am not really familiar with most of the syntax.

yeah sorry the code is quite confusing to me :frowning:

Should I just make this with HTML, CSS, and js?

No keep trying but you should rewrite it from scratch :smiley:

1 Like

I got it working!! :grin: