Python Strings Made Easy
Strings are just fancy ways to store text in Python. Whether you're making a chatbot or a game, you'll use these every single day. Let's break it down!
#
What is a String?
Think of a string as a chain of characters. You create one just by wrapping your text in quotes: "Hello World" or 'Hello World'.
+
Joining Strings
You can add strings together using the + sign. It’s like glue for text! "Hi" + " " + "You" results in "Hi You".
[]
Indexing
Each character has an address. If your name is "Harry", name[0] is 'H'. Just remember: Python starts counting at 0, not 1!
⟳
Looping
Need to see every letter one by one? Use a for loop: for char in "Code": print(char). It's that simple.