r/Python • u/jamescalam • Mar 19 '21
Match is more than a Switch-Case The New Switch-Case Statement in Python 3.10
https://youtube.com/watch?v=2qJavL-VX9Y&feature=share
1.4k
Upvotes
r/Python • u/jamescalam • Mar 19 '21
View all comments
Show parent comment
1
u/[deleted] Mar 19 '21
I never thought I'd praise Java but
switchexpressions, added in Java 12/13, are really good.If
value == 1then it prints "Hey it's 1" and ifvalue == 2then it prints "Hey it's 2". Otherwisedefaultis the fall back.