Just wrapped up strings in Python! Today I practiced: • Indexing & slicing • Common string methods (.upper(), .replace(), .count(), etc.) • f-strings ( way to format strings) Here’s code from a few exercises: python # String practice text = 'Hello, welcome to Python programming!' print(text.upper()) print(text.count('o')) print(text.find('Python')) new_text = text.replace('Python', 'the world of coding') print(new_text) # f-string example item = 'book' price = 19.99 quantity = 3 print(f"I bought {quantity} {item}s for ${price * quantity:.2f}") Output: HELLO, WELCOME TO PYTHON PROGRAMMING! 4 18 Hello, welcome to the world of coding programming! I bought 3 books for $59.97 Shoutout to Corey Schafer’s crystal-clear tutorial that inspired these exercises: https://lnkd.in/dvzNwUmM #Python
Mastering Python Strings with Indexing & f-strings
More Relevant Posts
-
24th's Python Class – Modules, Packages & __main__ In a recent Python session, we learned how Python programs are organized using modules and packages, and how code behaves when imported versus executed directly. 🔹 Modules Learned that every Python file is a module Used the import keyword to access functions and variables from another file Called functions and accessed data from custom modules 🔹 Packages Understood that a package is a directory containing multiple Python modules Learned the role of __init__.py in package initialization Discussed examples of popular packages like NumPy and Pandas 🔹 Libraries Learned that libraries can contain multiple packages and modules Understood the difference between: Standard libraries Third-party libraries 🔹 Importing Data from Modules Imported functions, lists, and dictionaries from a custom module Accessed dictionary values using module references 🔹 __name__ == "__main__" Learned how Python identifies whether a file is: Run directly as a script Imported as a module Used conditional execution to control what code runs in each case 🔹 Script vs Module Behavior Observed different outputs when a program is executed directly versus imported Used functions to demonstrate module reusability This class gave me a strong foundation in writing reusable, well-structured Python programs 🚀 #Python #Modules #Packages #PythonBasics #main #CodingPractice #StudentLearning #ProgrammingConcept Pooja Chinthakayala
To view or add a comment, sign in
-
-
🐍 90 Days of Python – Day 12 Today, I learned about modules and imports in Python, which help in organizing code and reusing functionality efficiently. As programs grow, writing everything in a single file becomes hard to manage. Modules allow us to split code into logical parts and reuse them whenever needed. Key concepts I explored today: • What a module is in Python • Using import to access built-in and custom modules • Importing specific functions using from ... import • Understanding why modular code is easier to maintain Modules encourage clean, structured, and reusable code, which is essential for real-world applications. I’m practicing these concepts to write more organized programs and avoid unnecessary repetition. 📌 Day 12 completed. Writing modular and reusable code. 👉 Which Python module do you use most often in your projects? #90DaysOfPython #PythonLearning #LearningInPublic #ProgrammingBasics #BTechCSE #MachineLearning
To view or add a comment, sign in
-
-
📌 Data Types in Python | Complete Fundamentals with Examples | Informational Share Sharing a clear and structured Python reference that explains all built-in Python data types with real-world examples and code snippets, making it ideal for beginners, interview preparation, and quick revision. 🔹 What this document covers: • Python as a dynamically typed language & use of type() • Text type: str with practical examples • Numeric types: int, float, complex • Sequence types: list, tuple, range • Mapping type: dict (key–value pairs) • Set types: set, frozenset • Boolean type: bool for logical conditions • Binary types: bytes, bytearray, memoryview • NoneType and its real-world usage • Type casting: implicit vs explicit conversion with examples 📄 The document also includes simple explanations, real-life use cases, and hands-on Python code, making complex concepts easy to understand. 📢 I’ll continue sharing high-value programming fundamentals, Python references, and interview-oriented content. Follow Pulimi Bala sankararao for more. #Python #PythonBasics #DataTypes #ProgrammingFundamentals #PythonInterview #LearningPython #TechInformation
To view or add a comment, sign in
-
🐍 90 Days of Python – Day 19 List Comprehensions Today, I learned about list comprehensions in Python, a more concise and Pythonic way to create lists. List comprehensions help combine loops, conditions, and expressions into a single readable line, making code cleaner and easier to understand. 🔹 Key things I learned today: • Basic syntax of list comprehensions • Creating lists using expressions • Adding conditional logic inside comprehensions • Replacing simple for loops with more compact code List comprehensions are especially useful in data processing and transformations, where readability and efficiency matter. I’m practicing these concepts to write cleaner and more expressive Python code. 📌 Day 19 completed. Writing more Pythonic code with list comprehensions. 👉 Do you prefer list comprehensions or traditional for loops, and why? #90DaysOfPython #PythonLearning #LearningInPublic #ListComprehension #PythonDeveloper #BTechCSE
To view or add a comment, sign in
-
-
Today’s Python focus was 𝗠𝗼𝗱𝘂𝗹𝗲𝘀. I worked on understanding how Python lets you organize code into reusable files instead of writing everything in one script. 𝗪𝗵𝗮𝘁 𝗜 𝗽𝗿𝗮𝗰𝘁𝗶𝗰𝗲𝗱 𝘁𝗼𝗱𝗮𝘆: • Importing built in modules like math and calendar • Using functions from the math module such as sqrt() and ceil() • Working with the calendar module to generate month level calendars • Creating a custom module to store reusable functions • Importing and using functions from a user defined module • Separating logic into different files for better structure and readability 𝗞𝗲𝘆 𝘁𝗮𝗸𝗲𝗮𝘄𝗮𝘆𝘀: • Modules help break large programs into smaller, manageable pieces • Built in modules save time and prevent rewriting common logic • Custom modules make code reusable across multiple scripts • Organizing functions into modules improves maintainability Working with modules made it clear how real Python projects are structured. Code is written once, organized properly, and reused when needed. If you are learning Python, are you already using modules in your practice or still keeping everything in a single file? #Python #PythonLearning #PythonModules #ProgrammingBasics #LearningInPublic #DataAnalytics #Upskilling
To view or add a comment, sign in
-
✨ Demystifying Python Strings for Beginners ✨ When I first started coding, strings felt deceptively simple—just text in quotes, right? But they’re the backbone of so many programs: storing names, messages, and even entire datasets. Here’s a quick snapshot of what you can do with strings in Python: 🔗 Concatenation: "Hello " + "World" → Hello World 📏 Length: len("Python") → 6 🎯 Indexing: "Python"[0] → P ✂️ Slicing: "Python"[1:4] → yth 🔠 Uppercase: "hello".upper() → HELLO 🔡 Lowercase: "HELLO".lower() → hello 💡 Strings aren’t just text—they’re powerful tools for manipulating and presenting information. I created this simple visual to help beginners see how strings work in action. If you’re starting your Python journey, mastering strings is a great first step toward building confidence with code. 👉 What’s the first string operation you learned that made you feel like a “real coder”? #Python #CodingForBeginners #LearnToCode #DataScience #EducationThroughStorytelling
To view or add a comment, sign in
-
-
In my first blog, I discuss the 5 (+2) steps of creating graphical user interface (GUI) applications using Python's FreeSimpleGUI library, which will allow us to elevate the creation of engineering templates beyond spreadsheets. While this requires a working knowledge of Python, hopefully everyone who are not that familiar with the programming language can benefit from this as well. The source code for the example in this post can be found toward the end, which you can download to modify, add new features, and customize to your liking. Enjoy! 😁 https://lnkd.in/gVGAA9fg
To view or add a comment, sign in
-
🐍 90 Days of Python – Day 27 Modules and Packages | Organizing & Scaling Python Code Today, I learned about modules and packages in Python, which help in organizing code, improving reusability, and building scalable applications. 🔹 Concepts covered today: ✅ Importing built-in and custom modules ✅ Understanding Python packages ✅ Using standard libraries effectively ✅ Creating your own modules ✅ Installing third-party packages using pip Modules and packages are essential for: Writing clean and maintainable code Reusing logic across multiple projects Working with Python libraries for data science Building real-world applications and systems This topic is especially important in data analysis and predictive analytics, where external libraries and modular code structures are used extensively. 📌 Day 27 completed — learning how to structure Python projects the right way. 👉 Which Python library do you use the most: pandas, numpy, or matplotlib? #90DaysOfPython #PythonModules #PythonPackages #LearningInPublic #CleanCode #PythonLibraries #PredictiveAnalyticsJourney
To view or add a comment, sign in
-
-
📌 Data Types in Python | Complete Fundamentals with Examples | Informational Share Sharing a clear and structured Python reference that explains all built-in Python data types with real-world examples and code snippets, making it ideal for beginners, interview preparation, and quick revision. 🔹 What this document covers: • Python as a dynamically typed language & use of type() • Text type: str with practical examples • Numeric types: int, float, complex • Sequence types: list, tuple, range • Mapping type: dict (key–value pairs) • Set types: set, frozenset • Boolean type: bool for logical conditions • Binary types: bytes, bytearray, memoryview • NoneType and its real-world usage • Type casting: implicit vs explicit conversion with examples 📄 The document also includes simple explanations, real-life use cases, and hands-on Python code, making complex concepts easy to understand. 📢 I’ll continue sharing high-value programming fundamentals, Python references, and interview-oriented content. #Python #PythonBasics #DataTypes #ProgrammingFundamentals #PythonInterview #LearningPython #TechInformation
To view or add a comment, sign in
-
📌 Data Types in Python | Complete Fundamentals with Examples | Informational Share Sharing a clear and structured Python reference that explains all built-in Python data types with real-world examples and code snippets, making it ideal for beginners, interview preparation, and quick revision. 🔹 What this document covers: • Python as a dynamically typed language & use of type() • Text type: str with practical examples • Numeric types: int, float, complex • Sequence types: list, tuple, range • Mapping type: dict (key–value pairs) • Set types: set, frozenset • Boolean type: bool for logical conditions • Binary types: bytes, bytearray, memoryview • NoneType and its real-world usage • Type casting: implicit vs explicit conversion with examples 📄 The document also includes simple explanations, real-life use cases, and hands-on Python code, making complex concepts easy to understand. 📢 I’ll continue sharing high-value programming fundamentals, Python references, and interview-oriented content. #Python #PythonBasics #DataTypes #ProgrammingFundamentals #PythonInterview #LearningPython #TechInformation
To view or add a comment, sign in
Explore related topics
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