Switch Case in Python:

Python does not support a switch or case statement. In python, dictionary mapping is there as a replacement of Switch case in Python for Data Science.

python for data science

So, this way you can write the above code in C++ :

To learn more about dictionaries in python for data science, you can check this and this as well.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.