Calculator
Komil (9)

It's a simple calculator with few operators, please take a look and give me feedback on what I can do to shorten it (and run the same way it does with this coding) or ways to improve it (extra coding to make it efficient?)

You are viewing a single comment. View All
Komil (9)

@eighty Thank you so much, this is actually very helpful.

Could you please answer these questions tho since I'm fairly new to coding

1)Could you please explain what global num1 does

2)why did you def num_prompt(), can I do it without defining it?

3) What does try: and, except do?

Lastly, the reason I put an input at the end to close the program is because when I put the program into my desktop and opened it without the editor, (Like I opened the program to straight up RUN it)
the program would run fine but at the end it closes instantly after printing the last code.

For example if I put print("Thank you") it would immediately close the program right after it prints the "thank you" and it wouldn't let the user see it, so I did it the input way so the user gets to see everything he did before he can close it on will.

Oh and also thank you for the .casefold, It's really helpful learning new things.

(Also if you got the extra time after responding, could you tell me how you edited your comment :p (Bold,italic,etc.)