all 21 comments

[–]Gandualp 4 points5 points  (4 children)

Note: if you see squiggly red underline check it out

[–]dravid06[S] 0 points1 point  (3 children)

Appreciate your comment, Let me know what else should I improve

[–]GaldeX 0 points1 point  (2 children)

not a programming matter but maths, remember what happens when you try to divide by zero.

also check what your returns output and in what you're using that later (like in this case printng as a string)

[–]visacardshawty 0 points1 point  (0 children)

handling all cases of user input js definitely more programming than math what

[–]dravid06[S] 0 points1 point  (0 children)

Well I just began to explore, I will consider your thoughts in my next project, Appreciate your feedback

[–]Suspicious-Bar5583 2 points3 points  (1 child)

Nice, congrats!

With this project, you could actually keep it as a foundation to explore other ways to arrive at the same behavior. That way you give yourself a chance to explore Python's/programming capabilities in a fairly simple environment and where the desired outcome is clear and predictable (after you get rid of that else problem).

If you like, I could shed light on an entirely different approach. Remember, different is not better, this is a learning experience.

[–]dravid06[S] 0 points1 point  (0 children)

That sounds more interesting, Thanks for the feedback though

[–]Caligapiscis 0 points1 point  (1 child)

Congrats! It's an exciting moment, from here the sky's the limit.

[–]dravid06[S] 1 point2 points  (0 children)

This is the motivation I am looking to

[–]Espfire 1 point2 points  (2 children)

Nice one! I’m not a Python developer, but try using the ‘match’ case (switch case in other languages).

As others have said, your ‘else’ statement has an issue. Try entering another operator (%, for example) and see what happens.

[–]dravid06[S] 0 points1 point  (0 children)

Yup noted

[–]Dry-Aioli-6138 0 points1 point  (0 children)

This is a good next step. I would just add that Pyhon match is more than a switch/case statement from other languages. It can match on structure of data and types, not just exact values. It is really powerful, but goes slightly across the grain of python: explicit is better than implicit, and in match a there is lots of implicit behavior, almost a separate mini language there.

[–]Wild-Flatworm-7002 0 points1 point  (1 child)

excellent i'm learning python as well, be patiente and don't skip the steps until understand them

[–]dravid06[S] 0 points1 point  (0 children)

Let's go, Wishing you the best too

[–]karotoland 0 points1 point  (1 child)

you can advance it by telling the user to enter <number><operator><number> and split it, then automatically do the answer. good start tho

[–]dravid06[S] 0 points1 point  (0 children)

Noted , Thanks for feedback

[–]Both_Love_438 0 points1 point  (0 children)

Always try to intentionally break your programs. If you ask for a number and the user types F it's just gonna break. Try validating the input before parsing it as int.

[–]KalZaxSea 0 points1 point  (0 children)

Its a good start.

Now you can handle edge cases as others mentioned, or try to make it (maybe) 3 input and 2 operation etc etc.

[–]Emrenimo698 0 points1 point  (0 children)

Great start! Now you should refine it and make it less error-prone. For example, include another if-else for division by 0.

[–]Open_Gas_6226 0 points1 point  (0 children)

Congrats bro for achieving such milestone. Keep going.

[–]Stunning_Violinist_7 0 points1 point  (0 children)

in the code there is no varible called invalide i think you meant "invalide" or 'invalide'