Hello! Before we go further into our CodingBat practice, I think it would be beneficial to learn more about strings in Python, something I probably should’ve gone over earlier. So, this post will explain what strings are and how we can interact with them.
What are Strings?
Strings are basically a sequence of individual characters. As we already know, to declare a string in Python we enclose it in quotations, like « Hello World ». To declare a variable as a string, we would just type in:
my_string = "Hello World"
Now, let’s talk about what strings really are. Although strings have their own data type, in reality strings are actually lists of individual characters. Consequently, we are able to interact with strings in some of the ways we did with lists. For example:
View original post 699 mots de plus