Country or region and language

    Choose your country or region and your language.

    Suggested for you

      All countries and regions

        Choose your character

        It shows in the top bar and on your profile. Change it any time.

        Python developer roadmap

        Follow a Python developer roadmap built around real work: core syntax, debugging, tests, Git, and a focused project in automation, backend, or data processing.

        A person practicing on a laptop in a quiet workspace

        Follow a Python developer roadmap in this order: core syntax, functions and collections, files and error handling, testing and Git, then one specialization. Start by maintaining a small existing script so you can practice reading code, correcting behavior, and checking your changes before building something larger.

        The route from syntax to useful work

        Useful Python development starts with understanding and changing existing programs, not memorizing a catalogue of language features. Day to day, you might investigate a rejected file, correct a calculation, add an input rule, or explain why yesterday's output changed.

        Use a change-impact map to connect each task to the next skill. Reading a script requires language fundamentals. Finding an incorrect calculation requires debugging, the process of locating and correcting a defect. Changing an input rule requires tests. Sharing a change requires version control, which records how files change over time.

        Your basic tools are Python 3, a text editor, and a terminal, where you enter commands. Add Git for version control as your project develops. Automation, backend development, and data processing share these foundations, but you don't need to learn all three branches together.

        Foundations through everyday tasks

        Learn enough language structure to explain a short program before adding external packages. Connect each feature to a task you can check:

        • Values and types: distinguish text read from a file from numbers used in calculations.
        • Conditions and loops: decide which records to accept and process records in sequence.
        • Lists and dictionaries: collect ordered items and associate names with values.
        • Functions and imports: name reusable logic and bring code from another module into your program.
        • Exceptions: recognize problems that interrupt normal execution and handle only the problems you expect.

        When Python stops, read the traceback, its error report. Find the exception type near the bottom, then locate the relevant line in your own file. A program that stops with an error needs a different investigation from a program that runs successfully but produces the wrong total.

        Practice these foundations with The Work Gym's Python course. The first unit is free without an account, and exercises are checked automatically with a hint that names the mistake.

        An inherited work-log script

        Maintain a work-log script that totals valid minutes and counts rejected records. The fictional exercise uses Python 3 and only its standard library, the modules included with Python, so you don't need external packages.

        Save the complete program below as worklog.py. Run the starting version before changing anything, using the command preserved in the comments. The command assumes Python 3 is available as python3, as on many macOS and Linux installations.

        Practice what this post teaches

        # Fictional exercise specification
        # Goal: accept integer text representing minutes greater than or equal to zero.
        # Reject other values; don't silently replace rejected values with zero.
        # Starting records: W1=30, W2=0, W3=oops, W4=45.
        # Save this complete program as worklog.py.
        
        import csv
        from io import StringIO
        
        DATA = "record,minutes\nW1,30\nW2,0\nW3,oops\nW4,45\n"
        
        
        def summarize(text):
            total = 0
            accepted = 0
            rejected = 0
            for row in csv.DictReader(StringIO(text)):
                try:
                    minutes = int(row["minutes"])
                    if minutes < 0:
                        raise ValueError("negative minutes")
                except ValueError:
                    rejected += 1
                    continue
                total += minutes
                accepted += 1
            return total, accepted, rejected
        
        
        if __name__ == "__main__":
            print(summarize(DATA))
        
        # Run the starting version: python3 worklog.py
        # Calculation: 30 + 0 + 45 = 75.
        # Expected output: (75, 3, 1)
        # Tuple order: total minutes, accepted records, rejected records.
        # Next, edit DATA: replace W3,oops with W3,15.
        # Keep summarize unchanged and save worklog.py.
        # Run the changed version: python3 worklog.py
        # Changed calculation: 30 + 0 + 15 + 45 = 90.
        # Expected changed output: (90, 4, 0)

        Read the function in execution order. StringIO makes the text behave like a file; csv.DictReader reads each row using column names. The int function converts minute text to an integer. The conversion and negative-value check sit inside a narrow try block, so the handler catches ValueError without hiding unrelated errors.

        The function returns a tuple, an ordered collection of results. The final guard runs the print statement when you execute the file, but not when another file imports the function. After checking the starting output, make the exact DATA edit specified above and run the program again.

        A repeatable development workflow

        Make development repeatable by turning expected behavior into automated tests and recording focused changes with Git. An automated test runs code and checks its result against a stated expectation.

        Save the following as test_worklog.py beside worklog.py, then run the command in its comments.

        # Fictional test specification for the work-log rule:
        # Accept integer text representing minutes >= 0; reject other values.
        # Keep worklog.py beside this file with summarize unchanged.
        # Save as test_worklog.py and run: python3 test_worklog.py
        
        from worklog import summarize
        
        original = "record,minutes\nW1,30\nW2,0\nW3,oops\nW4,45\n"
        # Calculation: 30 + 0 + 45 = 75; three accepted, one rejected.
        assert summarize(original) == (75, 3, 1)
        
        corrected = "record,minutes\nW1,30\nW2,0\nW3,15\nW4,45\n"
        # Calculation: 30 + 0 + 15 + 45 = 90; four accepted, none rejected.
        assert summarize(corrected) == (90, 4, 0)
        
        negative = "record,minutes\nW1,-5\n"
        # No accepted minutes; no accepted records; one rejected record.
        assert summarize(negative) == (0, 0, 1)
        
        empty = "record,minutes\n"
        # No data rows: total, accepted, and rejected are all zero.
        assert summarize(empty) == (0, 0, 0)
        
        print("4 checks passed")
        # Expected output: 4 checks passed

        Each assertion checks a condition and raises an error if the condition isn't true. Keep these beginner checks in a normal Python run; don't use assertions to enforce production input rules because Python can disable assertions. Later, move the cases into a dedicated test framework.

        With Git, inspect the differences between versions, run your checks, and record one coherent change. A commit records a version of tracked files, not proof that the program works. Keep your test results and your explanation of the change alongside that history.

        Introduce dependencies only when a project needs them. A dependency is an external package your project uses; a virtual environment isolates a project's installed packages. The work-log script doesn't need either an external package or a package installation step.

        For the next stage of practice, use the Python for software engineers course.

        A specialization chosen by output

        Choose your specialization by the output you want to build, while keeping functions, validation, tests, and readable code as shared foundations.

        Automation

        Build a local tool that processes work-log files. Learn file paths, command-line arguments that pass options to a program, logging that records what happened, and safe output handling. Show the skill with fictional input files, a documented run procedure, and checks that source files remain unchanged.

        Backend development

        Build a small service that accepts and retrieves work logs. Learn HTTP, the request-and-response protocol used by web services, followed by SQL for database queries, input validation, and one web framework. Document requests, expected responses, and tests; you don't need a browser interface to demonstrate backend behavior.

        Data processing

        Build a repeatable transformation from raw work logs to a checked summary. Learn tabular data handling, missing-value rules, and joins, which combine related tables. Show input totals, rejected records, and output checks rather than only a final chart. Advanced modeling isn't part of the shared beginner route.

        Portfolio evidence and next steps

        A useful portfolio demonstrates a change another person can reproduce and inspect. Include the original requirement, the changed rule or defect, your code, the checks, and the resulting output.

        Change-impact map
        Everyday taskPrerequisite skillPractice artifactExpected checkPortfolio evidence
        Read and debugTypes, loops, functionsAnnotated work-log scriptExplain the original resultDefect investigation notes
        Validate inputConversion and exceptionsExplicit acceptance ruleZero accepted; negative rejectedWritten input contract
        Protect behaviorAutomated testsFour repeatable checksExpected tuples matchRunnable test file
        Share a changeGit and focused commitsReviewed file differencesOnly intended edits recordedReadable change history
        Build a chosen outputBranch-specific toolsTool, service, or pipelineDocumented input matches outputReproducible project

        Work in order: reproduce the starting result, explain each line, make the specified input change, write the tests, and document how another person can run the project. Then build one specialization project. Return to earlier topics whenever the project exposes a gap.

        The in-memory exercise doesn't cover large-file performance, concurrent updates, authentication, or production operations. It also assumes the expected CSV columns exist. If you understand the example but struggle to adapt it, write a new requirement and its expected output before consulting the solution. Adapting assumptions is part of development, not a separate skill you acquire by finishing tutorials.

        Common questions

        What should I learn first to become a Python developer? Start with values, types, conditions, loops, collections, and functions. Use those features to read and change a small script, then add files, exceptions, and tests.

        When should I choose between automation, backend development, and data processing? Choose once you can explain a small program, change its behavior, and check the result. Pick the output you want to build rather than trying to study every branch at once.

        Do I need a framework before building my first Python project? No, a standard-library script can demonstrate validation, functions, file handling, and testing. Add a framework when the project needs its structure, such as handling web requests.

        How can I show Python skills without professional experience? Use fictional data and document a reproducible change from requirement to checked output. Include run instructions, tests, and an explanation of a mistake you found and corrected.

        How do I know when to move beyond beginner tutorials? Try changing a requirement without following the tutorial's solution. You're ready for a broader project when you can explain the affected code, predict the output, and write checks for the changed behavior.

        Practice what this post teaches

        Your Work Gym account

        Save your progress and pick up on another device. Your browser's progress comes with you.

        New accounts get 12 hours of full access: every course, unit, project and exam. The clock starts when you open your first lesson.

        Plan your practice from a job ad or syllabus

        Have a referral code?

        or

        You can keep practicing without an account.

        Help and feedback

        Ask a question, tell us what is not working, or share an idea. We reply by email.

        What is it about?

        We use it only to reply to you.