🚀 Day 2/60 – Installing Python & Writing Your First Program Yesterday we answered: What is Python? Today, let’s get our hands dirty 👇 🛠️ Step 1: Install Python 1️⃣ Go to: https://www.python.org 2️⃣ Download the latest version 3️⃣ IMPORTANT: Tick ✅ “Add Python to PATH” during installation 4️⃣ Click Install Done. That’s it. 💻 Step 2: Verify Installation Open terminal / command prompt and type: python --version If you see something like: Python 3.x.x You’re ready to go 🎉 ✍️ Step 3: Your First Python Program Create a file called: hello.py Add this line: print("Hello, World!") Run it: python hello.py Boom 💥 You just executed your first Python program. 🧠 What just happened? • print() → displays output • "Hello, World!" → a string • Python executed your file line by line 🔥 Pro Tip (Important for beginners) Use a code editor like: • VS Code • PyCharm They make coding 10x easier. 🔥 Challenge for today 1️⃣ Install Python 2️⃣ Run your first program 3️⃣ Comment “DONE” when finished Follow Adeel Sajjad to become pro python programmer #Python #LearnPython #PythonProgramming #Coding #Programming
Installing Python & Writing Your First Program with Adeel Sajjad
More Relevant Posts
-
Many Python I/O tutorials end at print() and open(). This one goes further. On PythonCodeCrack there's a full beginner tutorial on Python I/O that covers the ground many skip — not just how to use the tools, but why they work the way they do. What's inside: — stdin, stdout, and stderr: what they are, where they come from, and why Python didn't invent them — print() in full: sep, end, flush, and why flush=True doesn't mean your data is on disk — input() and why it always returns a string no matter what the user types — File modes r, w, a, and x — including why 'w' truncates before the first write, not during it — The three-layer CPython I/O stack (TextIOWrapper → BufferedWriter → FileIO) and how to inspect it live — PEP 393: why a single emoji in a 2 GB text file can force 4 bytes per character across the entire string — buffering=1 line-buffered mode for crash-safe log files — flush() vs os.fsync() — two entirely different operations that most tutorials treat as the same thing — Python 3.15 making UTF-8 the default on all platforms, and what that means for existing code — sys.__stdout__ vs sys.stdout, newline translation, file descriptors, and TOCTOU race conditions The tutorial includes interactive quizzes, spot-the-bug challenges, a code builder, predict-the-output exercises, a 15-question final exam, and a downloadable certificate of completion. https://lnkd.in/gbYPmYgv #Python #PythonProgramming #LearnPython #CodingEducation
To view or add a comment, sign in
-
🚀 Python Series – Day 2: Installing Python & Writing Your First Program Yesterday, we understood What is Python & Why it is powerful. Today, let’s take the first real step— installing Python and writing your first program 💻 🔧 Step 1: Install Python 1. Go to the official website: https://www.python.org 2. Download the latest version 3. While installing, IMPORTANT: ✔️ Check “Add Python to PATH” ▶️ Step 2: Verify Installation Open Command Prompt / Terminal and type: python --version 🧠 Step 3: Your First Python Program print("Hello, World!") 💡 What does this mean? print() → Used to display output "Hello, World!"→ Text (string) 🎯 Why is this important? This is your first step into coding. Every expert once started with this simple line. 🔥 Pro Tip: Try this: print("I am learning Python 🚀") ❓ Question for you: Have you written your first Python program yet? 👉 Comment YES / NO— I’d love to know! 📌 Tomorrow: Variables & Data Types (Most Important Topic!) #Python #DataScience #Coding #Programming #LearnPython #Beginners #Tech #MustaqeemSiddiqui
To view or add a comment, sign in
-
-
Day 46 : Python Conditional Statements – If/Else Today I understood the conditional statements used in Python. Hands-on : - Today I learned about conditional statements in Python, which are used to control the flow of a program based on conditions. - I started with the basic syntax of the if statement, understanding how Python evaluates conditions and executes code blocks. -I then explored the if/else statement, which allows execution of alternate code when a condition is false. - Moving forward, I practiced if/elif/else statements to handle multiple conditions efficiently. - I also learned how to write if/else in a single line (ternary operator), which makes simple conditions more concise. - Finally, I explored nested if/else statements, where one condition is placed inside another to handle more complex logic. Result : - Successfully understood how to implement conditional logic in Python using different forms of if/else statements. Key Takeaways : - If statement executes code only when a condition is true. - If/Else provides an alternative execution path. - If/Elif/Else helps handle multiple conditions efficiently. - One-line if/else (ternary) makes code concise for simple conditions. - Nested conditions allow handling complex decision-making scenarios. #Python #Programming #DataAnalytics #LearningJourney #ConditionalStatements #CodingBasics #DataScience #BeginnerPython #AnalyticsSkills
To view or add a comment, sign in
-
-
Nobody teaches you this in Python tutorials. You learn variables. You learn functions. You learn classes. But scope? You learn scope the hard way. At 2am. With a bug you can't explain. Staring at code that looks perfectly fine. Here's what's actually happening: Python doesn't look for variables the way you think it does. It follows a very specific lookup order - Local → Enclosing → Global → Built-in - and if you don't know the rules, it will surprise you in the worst moments. I wrote a free guide to fix that gap: ✔ How Python actually resolves variable names ✔ Why closures behave the way they do ✔ The global and nonlocal keywords demystified ✔ Real examples of scope bugs - and how to squash them No fluff. No theory for the sake of theory. Just the stuff that makes you a sharper Python dev. 🎁 Free download: https://lnkd.in/dY8az6hc Drop a 🐍 in the comments if scope has burned you before. #Python #PythonDeveloper #LearnPython #Debugging #Scope #Variable
To view or add a comment, sign in
-
🚀 Why should we use List Comprehension in Python? When working with Python, one of the most powerful and elegant features is List Comprehension. Instead of writing long loops, we can create lists in a single, readable line. 🔹 Example: Instead of: squares = [] for i in range(5): squares.append(i * i) print(squares) We can write: [i * i for i in range(5)] 💡 Why use List Comprehension? ✔ List comprehension is slightly faster because it reduces overhead (such as repeated append() calls) and uses optimized internal C-based execution instead of repeated Python-level loop operations ✔ Cleaner and more readable code ✔ Less boilerplate (fewer lines of code) ✔ Easy filtering with conditions ✔ More Pythonic way of writing code ⚡ It helps you write logic in a compact and efficient way without losing clarity. But remember: 👉 Use it for simple logic 👉 For complex logic, normal loops are still better for readability 💬 Final thought: “Write code that is not just correct, but also clean and Pythonic.” #Python #Programming #DataScience #Coding #MachineLearning
To view or add a comment, sign in
-
🚀 Mastering Loops in Python 🐍 Loops in Python are essential for repeating tasks efficiently. They allow you to iterate over a sequence of elements such as lists or strings, executing the same block of code multiple times. This is incredibly useful for automating repetitive operations and processing large amounts of data in your programs. For developers, understanding loops is crucial as they form the backbone of many algorithms and data processing tasks. By mastering loops, you can write more concise and elegant code, improving the efficiency and readability of your applications. 🔎 Let's break it down step by step: 1️⃣ Initialize a counter variable 2️⃣ Set the condition for the loop to continue 3️⃣ Execute the code block inside the loop 4️⃣ Update the counter to progress through the sequence ```python # Example of a for loop in Python for i in range(5): print("Iteration", i) ``` 🚩 Pro Tip: Use `enumerate()` to access both the index and value of an item in a loop effortlessly. ❌ Common Mistake: Forgetting to update the counter variable in a loop, leading to an infinite loop and crashing your program. 🤔 What's your favorite use case for loops in Python? 🌐 View my full portfolio and more dev resources at tharindunipun.lk #PythonProgramming #DeveloperTips #CodingCommunity #LearnToCode #LoopInPython #CodeNewbie #TechTalks #ProgrammingLife
To view or add a comment, sign in
-
-
For my Day 15 I covered Python String Formatting and I have to say — this one clicked really fast for me. Here is what I covered: F-Strings This is the modern way to format strings in Python (available from version 3.6). All you do is put the letter f in front of your string and use curly brackets {} to drop in your variables directly. It is clean, simple, and easy to read. I actually enjoyed writing these. .format() Method This is the older way of doing the same thing. Instead of putting f at the front, you write your string normally and call .format() at the end to pass in the values. Still works perfectly and good to know, but f-strings feel much neater. Placeholders and Modifiers This was my favourite part. Inside the curly brackets {}, you can add a colon : followed by a modifier to control exactly how your value is displayed. For example: :.2f gives you 2 decimal places :, adds a comma as a thousand separator :% converts a number to a percentage :> :< :^ lets you align your text right, left, or centre So instead of just printing a raw number like 1500000, I can now print it as $1,500,000.00. That small difference makes everything look so much more professional. As someone learning Python for data analysis, I can already see how useful this will be when I start working with real data and building reports in pandas. Day 16 we go into revision mode 5 days of practicing everything I have covered so far before jumping into pandas. The foundation is almost ready. #Python #100DaysOfCode #DataAnalysis #LearningInPublic #W3Schools #NeverStopLearning
To view or add a comment, sign in
-
-
Day 2 of 30 — Python for Automation 🐍 The #1 reason people never start automating their work? “I don’t know how to set it up.” So today — let’s fix that in under 5 minutes. Here’s how to get Python running on your computer right now: Step 1 — Download Python 👉 Go to python.org/downloads Click the big yellow button. That’s it. Step 2 — Install it ☑️ Check the box that says “Add Python to PATH” (This one step saves you hours of headaches later) Then click Install. Step 3 — Test it Open your terminal or command prompt and type: python --version If you see a version number — you’re ready. 🎉 Step 4 — Write your first line of Python Type this: print("Hello, I just automated my first output!") Hit Enter. That’s your first Python program. Done. No degree. No bootcamp. No confusion. Just 4 steps and you’re set up for everything in this series. 📌 Save this post for when you’re ready to set up. 🔔 Follow so you don’t miss Day 3 — where we write your first real automation script.
To view or add a comment, sign in
-
Day 1/30 Why Python code looks so simple (especially to beginners) I wrote a few lines of Python today, and my first reaction was: “Why does this look… too easy?” Coming from C++, I’m used to writing things like: int x = 10; But in Python, it’s just: x = 10 No type. No semicolon. No extra syntax. At first, it feels great. Less to write, less to think about. But then I realized: Python isn’t removing complexity. It’s just hiding it. The language handles a lot behind the scenes, so you can focus on logic instead of types or memory. That’s probably why beginners find it easier to start with. But coming from C++, it feels different. I’m used to having more control. Python feels more like trusting the system to do the right thing. Still getting used to it, but I can already see why people move faster with it. Let’s see how this plays out over the next few days. #Python #cpp#LearningInPublic #30DaysOfCode
To view or add a comment, sign in
-
-
Most people don’t forget Python They forget it because they stop using it. That was my problem. I came back to coding and realized something frustrating: I understood the concepts… but I couldn’t remember the syntax clearly. So instead of just relearning randomly, I did something different. I built a complete Python A–Z repository — not just to learn, but to never forget again. What makes this different? This is NOT just notes. This is a structured, practical guide designed to: 1. Help you quickly recall Python syntax after a break 2. Give you clear explanations with examples 3. Take you from basics to advanced step by step 4. Be your go-to reference anytime you feel lost What’s inside? 1. Python Fundamentals 2. Control Flow 3. Loops 4. Data Structures 5. Functions 6. Object-Oriented Programming (OOP) 7. File Handling 8. Error Handling 9. Modules & Packages 10. Advanced Python (Decorators, Generators, etc) Why I’m sharing this: Because I know many people struggle with the same thing: You learn… you stop… you forget… you start again. This is built to break that cycle. GitHub Repository: https://lnkd.in/dUSyqH2h What’s next? 1. More projects. 2. More practical content. 3. More real-world applications. I’ll keep sharing everything I build along the way. If you're learning Python or working on improving your skills, follow me I’ll be sharing practical content that actually helps. And tell me: What’s the hardest thing for you in Python right now? #Python #Programming #AI #MachineLearning #DataScience #SelfLearning
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