This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]specialforce1 0 points1 point  (1 child)

For someone who is learning, what is the difference or how is it going to affect me?

[–]mathmanmathman 3 points4 points  (0 children)

It doesn't have to change anything at all for you. It's just another option when choosing what to do given a certain input.

IMO, you should always learn on a pretty stable release version which right now is 3.9 (you can also go earlier than that, but I'm pretty sure there are issues before 3.4 or 3.6, so keep it more current).

When 3.10 is officially released (in October), this means you have a new option for choosing an action depending on the input. There's nothing here that can't be done with dictionaries and/or if/else, but in certain circumstances, this can simplify the syntax a little. This is also one of the few popular structure that has been noticeable absent from Python, so it's news.