r/PythonLearning • • May 26 '26

Discussion Here's a simple potion game. What do yall think

Post image
187 Upvotes

29 comments sorted by

View all comments

Show parent comments

-3

u/mati-33 May 26 '26
  1. There is no switch case in python

  2. Python's structural pattern maching is far more than switch case seen in other languages

  3. Beginners should master basic if-elif-else first

  4. There will be no improvement to that code if OP will just simply replace if-elif statements with match case

1

u/cryybash May 31 '26

match case is literally just switch case but for Python

1

u/mati-33 May 31 '26

no, it's not "just switch case", its structural pattern matching and that's a big difference.
I recommend checking out this great guide about match case

1

u/cryybash May 31 '26

You took that way too literally (my fault because i actually said literally), they behave different but you can do anything with a match case that you could with a switch case and then some, thats all I mean’t. I feel like you are just going for a gotcha moment when the technicalities are kind of irrelevant considering i was making a generalized statement. I will give you points on the fact that I shouldn’t have used “literally” i overuse that word too much.

1

u/cryybash May 31 '26

No disrespect either, i know the differences are still important, i will check out the guide

0

u/Haunting-Ad2065 May 30 '26

There are switch cases is py what do you mean match/case.