Python Strings: Single, Double & Multiline Basics

🔷 Python Strings – Single, Double & Multiline Strings are used to store text data in Python. They are written inside single quotes (' ') or double quotes (" "). 🔹 1️⃣ Single Quotes & Double Quotes Both single and double quotes work the same in Python. ▶ Example print('hi') print("hi") ✔ Output: hi 🔹 2️⃣ Using Quotes Inside Strings We can use single quotes inside double quotes and vice versa. ▶ Example print("my programming language is 'python'") print('my programming language is "python"') ✔ Output: my programming language is 'python' my programming language is "python" 🔹 3️⃣ Storing Strings in Variables We can store strings in variables. ▶ Example name = 'neena' print(name) ✔ Output: neena 🔹 4️⃣ Multiline Strings (Triple Quotes) To write strings in multiple lines, we use triple quotes (""" """). ▶ Example a = """ qwer aasfghjkk zxvnm """ print(a) ✔ Output: qwer aasfghjkk zxvnm 📌 Learning strings is important for working with text, messages, and user input. #Python #PythonStrings #LearningPython #DataAnalyticsJourney #CodingLife

  • graphical user interface, text, application, email

To view or add a comment, sign in

Explore content categories