String Manipulation
Today, we will discuss string manipulation, including slicing and formatting with f-strings.
` ˙⋆˖⁺‧₊☽◯☾₊‧⁺˖⋆˙ `
Escape Sequence
Escape sequences help to manipulate strings format and use some special symbols.
\\ : Symbol Backslash\" : Symbol Double-Quotes\' : Symbol Quote\n : New Line
Escape sequences can be placed at any spot of a string.
Slicing Strings
Slicing allows you to extract parts of a string. You can use the slice notation [
In this example, text[
Integrating Variables into Strings
You can combine strings and variables to create dynamic messages. This can be done using concatenation or f-strings.
Concatenation – using the+ operator to combine strings and variables.f-strings – inserting variables directly into strings using curly braces «{ }».
In this example, both concatenation and f-strings are used to insert the values of
Practical Application
In the Hall of Echoes, you will master the art of string manipulation. This involves slicing strings to extract specific parts and using f-strings to create dynamic messages.
Welcome, Mage Luna!