Fun with Python 🐍
@yourpythonfun.bsky.social
Posting stuff about #Python
🌌 Code snippet for multiple replacements:
`replacements = [("hello", "hi"), ("world", "Earth")]`
`for old, new in replacements:`
` text = text.replace(old, new)`
No more repetitive lines!🔥 #CleanCode
`replacements = [("hello", "hi"), ("world", "Earth")]`
`for old, new in replacements:`
` text = text.replace(old, new)`
No more repetitive lines!🔥 #CleanCode
November 10, 2025 at 7:19 PM
🌌 Code snippet for multiple replacements:
`replacements = [("hello", "hi"), ("world", "Earth")]`
`for old, new in replacements:`
` text = text.replace(old, new)`
No more repetitive lines!🔥 #CleanCode
`replacements = [("hello", "hi"), ("world", "Earth")]`
`for old, new in replacements:`
` text = text.replace(old, new)`
No more repetitive lines!🔥 #CleanCode
🔧 Here's how you use `.replace()` in action:
📍 `text = "hello, world!"`
📍 `new_text = text.replace("hello", "hi")`
Simple and effective for single replacements! 🛠️ #StringManipulation
📍 `text = "hello, world!"`
📍 `new_text = text.replace("hello", "hi")`
Simple and effective for single replacements! 🛠️ #StringManipulation
November 10, 2025 at 7:19 PM
🔧 Here's how you use `.replace()` in action:
📍 `text = "hello, world!"`
📍 `new_text = text.replace("hello", "hi")`
Simple and effective for single replacements! 🛠️ #StringManipulation
📍 `text = "hello, world!"`
📍 `new_text = text.replace("hello", "hi")`
Simple and effective for single replacements! 🛠️ #StringManipulation
November 5, 2025 at 10:26 PM
November 5, 2025 at 10:26 PM
2️⃣ Converting Python objects back to JSON is just as simple!
😎 Check out the code example for using `json.dumps()`, which returns a JSON string from a Python dictionary. #JSONHandling #LearnPython
😎 Check out the code example for using `json.dumps()`, which returns a JSON string from a Python dictionary. #JSONHandling #LearnPython
October 11, 2025 at 11:48 AM
2️⃣ Converting Python objects back to JSON is just as simple!
😎 Check out the code example for using `json.dumps()`, which returns a JSON string from a Python dictionary. #JSONHandling #LearnPython
😎 Check out the code example for using `json.dumps()`, which returns a JSON string from a Python dictionary. #JSONHandling #LearnPython
1️⃣ Parsing JSON strings to Python objects is easy with the `json` module.
🚀 Code example below shows how to convert a JSON string to a Python dictionary. Use `json.loads()` to achieve this. #CodeExample #PythonBasics
🚀 Code example below shows how to convert a JSON string to a Python dictionary. Use `json.loads()` to achieve this. #CodeExample #PythonBasics
October 11, 2025 at 11:48 AM
1️⃣ Parsing JSON strings to Python objects is easy with the `json` module.
🚀 Code example below shows how to convert a JSON string to a Python dictionary. Use `json.loads()` to achieve this. #CodeExample #PythonBasics
🚀 Code example below shows how to convert a JSON string to a Python dictionary. Use `json.loads()` to achieve this. #CodeExample #PythonBasics
🌌 Code snippet for multiple replacements:
`replacements = [("hello", "hi"), ("world", "Earth")]`
`for old, new in replacements:`
` text = text.replace(old, new)`
No more repetitive lines!🔥 #CleanCode
`replacements = [("hello", "hi"), ("world", "Earth")]`
`for old, new in replacements:`
` text = text.replace(old, new)`
No more repetitive lines!🔥 #CleanCode
August 15, 2025 at 10:26 PM
🌌 Code snippet for multiple replacements:
`replacements = [("hello", "hi"), ("world", "Earth")]`
`for old, new in replacements:`
` text = text.replace(old, new)`
No more repetitive lines!🔥 #CleanCode
`replacements = [("hello", "hi"), ("world", "Earth")]`
`for old, new in replacements:`
` text = text.replace(old, new)`
No more repetitive lines!🔥 #CleanCode
🔧 Here's how you use `.replace()` in action:
📍 `text = "hello, world!"`
📍 `new_text = text.replace("hello", "hi")`
Simple and effective for single replacements! 🛠️ #StringManipulation
📍 `text = "hello, world!"`
📍 `new_text = text.replace("hello", "hi")`
Simple and effective for single replacements! 🛠️ #StringManipulation
August 15, 2025 at 10:26 PM
🔧 Here's how you use `.replace()` in action:
📍 `text = "hello, world!"`
📍 `new_text = text.replace("hello", "hi")`
Simple and effective for single replacements! 🛠️ #StringManipulation
📍 `text = "hello, world!"`
📍 `new_text = text.replace("hello", "hi")`
Simple and effective for single replacements! 🛠️ #StringManipulation
August 11, 2025 at 8:28 PM
August 11, 2025 at 8:28 PM
August 3, 2025 at 6:19 PM
August 3, 2025 at 6:19 PM
2️⃣ Converting Python objects back to JSON is just as simple!
😎 Check out the code example for using `json.dumps()`, which returns a JSON string from a Python dictionary. #JSONHandling #LearnPython
😎 Check out the code example for using `json.dumps()`, which returns a JSON string from a Python dictionary. #JSONHandling #LearnPython
August 3, 2025 at 3:50 PM
2️⃣ Converting Python objects back to JSON is just as simple!
😎 Check out the code example for using `json.dumps()`, which returns a JSON string from a Python dictionary. #JSONHandling #LearnPython
😎 Check out the code example for using `json.dumps()`, which returns a JSON string from a Python dictionary. #JSONHandling #LearnPython
1️⃣ Parsing JSON strings to Python objects is easy with the `json` module.
🚀 Code example below shows how to convert a JSON string to a Python dictionary. Use `json.loads()` to achieve this. #CodeExample #PythonBasics
🚀 Code example below shows how to convert a JSON string to a Python dictionary. Use `json.loads()` to achieve this. #CodeExample #PythonBasics
August 3, 2025 at 3:50 PM
1️⃣ Parsing JSON strings to Python objects is easy with the `json` module.
🚀 Code example below shows how to convert a JSON string to a Python dictionary. Use `json.loads()` to achieve this. #CodeExample #PythonBasics
🚀 Code example below shows how to convert a JSON string to a Python dictionary. Use `json.loads()` to achieve this. #CodeExample #PythonBasics