Harini M S’ Post

🚀 𝐓𝐞𝐱𝐭 𝐕𝐚𝐫𝐢𝐚𝐛𝐥𝐞𝐬 𝐢𝐧 𝐏𝐲𝐭𝐡𝐨𝐧:  Python allows storing text in variables using either double quotes (" ") or single quotes (' ') — both behave the same way. 🔹  𝐒𝐢𝐧𝐠𝐥𝐞 𝐪𝐮𝐨𝐭𝐞𝐬 𝐯𝐬 𝐃𝐨𝐮𝐛𝐥𝐞 𝐪𝐮𝐨𝐭𝐞𝐬 - Both can be used to store strings. text = "Hello" print(text) text = 'Hello' print(text) 𝘖𝘶𝘵𝘱𝘶𝘵: Hello Hello 🔹 𝐌𝐮𝐥𝐭𝐢-𝐥𝐢𝐧𝐞 𝐭𝐞𝐱𝐭 𝐮𝐬𝐢𝐧𝐠 𝐭𝐫𝐢𝐩𝐥𝐞 𝐪𝐮𝐨𝐭𝐞𝐬 text = """ Hello Python """ print(text) 𝘖𝘶𝘵𝘱𝘶𝘵: Hello Python 🔹 𝐔𝐬𝐢𝐧𝐠 \𝐧 𝐟𝐨𝐫 𝐥𝐢𝐧𝐞 𝐛𝐫𝐞𝐚𝐤𝐬 text = """ Hello\nPython """ print(text) 𝘖𝘶𝘵𝘱𝘶𝘵: Hello Python Simple features like these make Python very convenient when formatting text and printing structured output #Python #Coding

To view or add a comment, sign in

Explore content categories