👉 We all use quotes in Python… But do you know when to use: ' vs " vs '''? Most beginners just use them randomly. Here’s the simple rule 👇 # Single quotes → simple text name = 'Ali' # Double quotes → when text has ' msg = "It's a good day" # Triple quotes → multi-line / docstrings text = '''This is multi-line text''' That’s it. No confusion. No overthinking. --- 💡 Good code is not just about working… It’s about being clear and readable. --- Do you follow this… or just use quotes randomly? #Python #LearnPython #CodingBasics #ProgrammingConcepts #PythonTips #CodeClarity #CleanCode #LearnWithMe #strings
Shahid Malik’s Post
More Relevant Posts
-
Most Python beginners don’t use this simple function. len() It looks small. But it’s very powerful. You can use it to find the length of: 👉 Strings 👉 Lists 👉 Tuples 👉 Dictionaries Example: text = "Python" print(len(text)) # Output: 6 numbers = [10, 20, 30] print(len(numbers)) # Output: 3 Instead of manually counting… Let Python do the work. 👉 Did you know about this function before? #Python #BluJayTechnologies #SoftwareTraining #Learning
To view or add a comment, sign in
-
-
If you get this right… your Python fundamentals are solid 😏 Python Series — Day 4 🧠 This one has confused a lot of developers (including me once 👀) What will be the output? def add_item(item, lst=[]): lst.append(item) return lst print(add_item(1)) print(add_item(2)) print(add_item(3)) Options: A. [1] [2] [3] B. [1] [1, 2] [1, 2, 3] C. Error D. Something unexpected 👀 Don’t rush this one. 👉 Think: Is the list created every time… or reused? Drop your answer 👇 Let’s see who gets it right 🔥 Answer tomorrow 🚀 #Python #CodingChallenge #LearningInPublic #Tech #DataEngineering
To view or add a comment, sign in
-
-
Most Python beginners don’t understand this concept clearly. List vs Set. They look similar… But they behave very differently. Here’s the simple difference: List: • Allows duplicate values • Maintains order • Example: numbers = [1, 2, 2, 3] Set: • Does NOT allow duplicates • Unordered collection • Example: numbers = {1, 2, 2, 3} → Output: {1, 2, 3} So when should you use them? 👉 Use a List when order matters 👉 Use a Set when you want unique values Understanding this can help you write cleaner and efficient Python code. 👉 Did you know this difference before? #blujaytechnologies #pythonlearning #softwaretraining
To view or add a comment, sign in
-
-
🚀 #100DaysOfPython – Day 1: List Comprehension Starting my Python journey by revisiting one of the most elegant features in Python – List Comprehension. 👉 It provides a concise way to create lists. Instead of writing: squares = [] for i in range(5): squares.append(i*i) You can simply write: squares = [i*i for i in range(5)] ✨ Cleaner ✨ More readable ✨ More Pythonic 💡 You can also add conditions: even_squares = [i*i for i in range(10) if i % 2 == 0] 📌 Why it matters? - Reduces lines of code - Improves readability (when used correctly) - Widely used in real-world Python codebases 🔍 My takeaway: List comprehensions are powerful, but overusing them can hurt readability. Keep them simple! #Python #CodingJourney #LearnPython #100DaysOfCode #WomenInTech
To view or add a comment, sign in
-
One of the biggest mistakes beginners make in Python… is ignoring data types. You might write correct code, But if you don’t understand the type of data you’re working with, Your results can be completely wrong. In Python, everything has a type, from numbers to text to collections of data. Understanding this is what separates someone who copies code from someone who actually understands it. I’ll be breaking down Python data types in a simple way in my next article. 💬 Which one confuses you the most: Booleans, strings, tuples, lists, or dictionaries? #Python #Programming #DataScience #AI #Beginners #LearnToCode #Tech
To view or add a comment, sign in
-
-
Python Logic: Is this Math or Magic?🤔 Day 8 of my Python journey! C++ logic tells me: You can't add words to numbers. Python logic says: Hold my coffee ☕ Check out this snippet: result = True + True + False * True What do you think the print(result) output will be? Drop your guess in the comments! 👇 A) True B) 2 C) 3 D) Error Hint💡: It comes down to how Python stores Booleans as Integers! #Python #LearninginPublic #30DaysOfCode #ProgrammingLogic #Day8
To view or add a comment, sign in
-
-
Python Challenge – Can you solve this? Today was all about deep-diving into Lists vs. Sets and I came across a common mistake that we can sometimes overlook. Let’s test your Python understanding👇 numbers = [1, 2, 3] numbers.append([4, 5]) print(len(numbers)) A) 3 B) 4 C) 5 D) Error It’s a classic interview question that tests if you truly understand how Python handles memory and lists. Day 15/30 #30DaysOfCode #DataStructures #Day15 #PythonQuiz
To view or add a comment, sign in
-
-
🧠 Python Logic Check — Quick Challenge Consider the following snippet: x = 10 x += x == 10 print(x) At first glance, it looks straightforward — but it tests your understanding of how Python handles boolean expressions. 💡 Question: What will be the output? A) 10 B) 11 C) True D) Error 📌 Small details like this often separate beginners from experienced developers. 💬 Drop your answer in the comments — and explain your reasoning if you can. #Python #SoftwareEngineering #CodingChallenge #DeveloperMindset #Learning
To view or add a comment, sign in
-
-
Python Today’s topic: Lists & Tuples What I learned: Creating lists and tuples Accessing elements using indexing Difference between mutable and immutable data types Example: list = [1, 2, 3] tuple = (1, 2, 3) Building strong fundamentals step by step #Python #Learning #Beginner
To view or add a comment, sign in
-
Tried learning 𝒓𝒆𝒄𝒖𝒓𝒔𝒊𝒐𝒏 in Python today 🤓 At first, this line was confusing: 𝘀[-𝟭] + 𝗿𝗲𝘃𝗲𝗿𝘀𝗲_𝘀𝘁𝗿(𝘀[:-𝟭]) Step by step break kiya aur finally it clicked 💡 Basically, last character is picked and combined with the reversed remaining string. Still practicing, but this made me realize coding isn’t just about syntax — it’s about building the right way of thinking 🧠 How do you usually approach recursion problems? Any tips for beginners? 💡 #Python #Recursion #CodingJourney #LearningInPublic #WomenTech
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development