Topic 5 String Formatting and a Pythonic Equivalent of a switch
-case
Statement
You probably already know what a string is in Python: an array of sequenced characters enclosed in single, double, or even triple quotes. Furthermore, you may have also seen prof. Marek or Mu perform string concatenation like so:
= "My name" + " is " + "Kevin!" sentence
And while this works, what if I told you that this isn’t the only way to format strings? In fact, there are three more ways to do the same thing (at least to my knowledge)!
When you’re ready, go to the next subsection of the webpage!