r/PythonProjects2 • • Oct 13 '25

Seeking Feedback on My First Python Project: Calculator .

Post image
26 Upvotes

14 comments sorted by

View all comments

2

u/corey_sheerer Oct 13 '25

Line 15, the check, it is cleaner to raise a value error rather than needing to nest if/else statement:

if x not in ....:
  raise ValueError('not a valid operator")

# now you can do conditions not nested
if XYZ;
  ...

Also, personally, I like the switch statement better than many else if statements. Can check it out.