
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
Begin from the very start with a ten-day Python blitz for new programmers. Explore basics, game programming, and core topics like data structures, conditionals, and loops.
Launch python.org's interactive shell to print hello world and explore basics like variables and simple arithmetic, then prepare to install Python on Mac or Windows.
Organize a ten-day, two-hours-per-day course with short videos, covering core Python concepts, a text-based RPG, object-oriented programming, a Ninjas vs Monsters graphic video game, and code challenges.
Code along with Python lessons using a public GitHub repository. Find lecture-specific files via tags and branches, download the exact course state, and reset when needed to follow along.
Guide students through verifying and installing Python 3 on macOS, using python.org downloads, a DMG installer, and setting up Visual Studio Code for Python development.
Guide Windows users through installing Python and Visual Studio Code from python.org and code.visualstudio.com. Configure path, use PowerShell, and run Python commands in Visual Studio Code's integrated terminal.
Configure your Python environment with Visual Studio Code, create a workspace, and save scripts like test.py in a basics folder. Run them with python three test.py and troubleshoot issues.
Master key terminal shortcuts for running Python: use tab for auto-complete, up arrow for history, clear with ctrl-k or command-k, and kill with ctrl-c.
Use the QA section to get help fast by searching or filtering threads, and learn by answering others; report mistakes and engage the Udemy community to improve the course.
Discover what Python is and how it works: a program run in the terminal, using valid syntax to communicate with the OS, UI, and kernel, hardware, and software.
Learn how to start coding by building from the ground up, focusing on variables and data types, then dictionaries, lists, security, and architecture, with Python 3.11 and pi game.
Explore variables in Python by assigning values, updating counts, and using snake_case, with emphasis on reserved words, comments, and basic printing.
Explore Python data types, including strings, integers, floats, and booleans, plus primitive versus non-primitive structures, using print and type to inspect values.
this lecture explains python data types—integers, floats, strings, and booleans—and why mixing them is risky, then demonstrates collecting input and concatenating strings to greet users.
Master Python conditionals by building if/else logic with indentation, exploring name-based outputs, input, and print statements, while learning indentation rules and the spaces versus tabs pitfall.
Learn why Python enforces spacing and indentation and how it helps beginners write readable, legible, error-free code by avoiding spaces and tabs mixups.
Learn how Python handles multi-part conditionals with if, elif, and else; compare chained elifs to separate if statements and see how only the first true branch runs.
Learn how Python uses operators and operands to perform math and string operations, with examples of +, -, *, /, concatenation, and comparison symbols.
Learn how casting changes a variable's data type in python, converting strings to integers or floats, and using int and str to safely perform operations with user input.
Guide students through a practical guess the number challenge, using input, casting, and conditionals to compare the user guess with the correct number and reveal closeness.
Join the code challenge walkthrough to build a Python number guessing game: convert input to int, use if-else with exact and close guesses, and concatenate messages.
Learn how to use f-strings in Python 3.6 to interleave variables with text, simplifying string formatting and avoiding concatenation errors as shown with cookie count and country examples.
Explore multi-condition and complex conditionals in Python by using or and and to combine checks, illustrated with name and number conditions and a guessing game.
Refactor the guess the number game to use or conditions, simplify duplicated lines, and explain operator precedence and the role of parentheses in and/or combinations.
Explore checking data types in Python by using type comparisons with int, str, and float, and combining conditions with and, or, and parentheses for correct logic.
Plan your trajectory through Python fundamentals by exploring loops, lists and dictionaries, functions, and the module system, while grounding your skills in variables, data types, and conditionals.
Explore python loops, using indentation and a colon to define the loop block, and learn while and for loops that repeat code until stop conditions, illustrated by washing dishes.
Master Python loop syntax by building a while loop with a counter and a for loop using range, while avoiding infinite loops and applying simple conditions.
Update the guessing game to run until the correct number is guessed using a while loop and keep_guessing, with input casting and feedback. Reorganize the project into code challenges.
Refine a guessing game by switching to a for loop driven by a user-specified number of tries, casting input to int, and breaking early when guessed.
Explore lists as a data type in Python, creating lists with square brackets, storing multiple items in one variable, and accessing items via zero-based indices with examples like country names.
Construct and explore Python lists in a hands-on playground, including empty lists, lists of strings and mixed data types, indexing elements, and using len and f-formatting to print results.
Explore python.org docs to understand built-in types, booleans, lists, and other data structures, and learn how the library and language references guide coding.
Learn how the append method, a built-in Python list operation, adds items to a list using dot notation and updates length and prints the result.
Learn how the Python list insert method places a value at a specific index, contrasting it with append. Use pop and remove to delete by index or by value.
Explore essential list methods in Python by applying clear, count, sort, and reverse to a sample animals list, learn counting occurrences, reinitializing lists, and sorting rules.
Explore how to loop over lists and strings with for loops, understand iterables like range, and use simple conditionals to print results such as car messages.
Define named blocks of code called functions, invoked with arguments using def and a signature of parameters in parentheses, and relate them to methods on objects.
Learn how to define and call Python functions with def, pass parameters, and manage indentation to reuse code and produce outputs using x and y.
Prioritize readable, well-organized code over clever, complex solutions; focus on intuitive function-driven structure that makes tickets easy to review and maintain for the whole team.
Master how Python maps arguments to parameters, defines function signatures, and uses named arguments to pass values in any order, ensuring x, y, and operation are correct.
Explore variable scope in Python by distinguishing global and local scope within functions, using examples with calc, indentation cues, and the cookie jar analogy to show visibility rules.
Explore how the global keyword controls variable scope in Python, differentiate global and local variables, and learn best practices for renaming locals to avoid conflicts.
Engage in a hands-on Python coding challenge, apply what you learn, use built-in tests and hints, and run code in a Visual Studio Code–like window to verify solutions.
Tackle a coding challenge to print the 100th Fibonacci number using a loop, a function, and list operations like append, starting from zero and one.
Learn to print the 100th fibonacci number in Python by building a fib list with a for loop, appending numbers via a function, and using zero-based indexing.
Apply the return statement to make functions reusable by sending back values from calc, such as x plus y, and pass arguments to call calc for single numbers or lists.
Learn to use the return statement in Python by implementing an is_palindrome function, iterating over a list of words with a for loop, and printing test results.
Convert a word to a list, reverse it with list reverse, join back to a string, and compare to the original to determine if it is a palindrome.
Explore finding an element in a list or string in Python by looping over characters, using length and range, and identifying a target index such as a specific letter.
Learn to use index and find to locate letters in strings and lists, loop with for, and understand positions and negative results when not found.
Explore the Caesar cipher by shifting letters to encode and decode, then tackle a code challenge using loops and functions in Python to print the correct string at line 20.
Explore a Caesar cipher walkthrough: decrypt each letter using a shifted alphabet, handle spaces and punctuation, and compare find-based versus list-based index approaches.
Learn about tuples as immutable, built-in Python data types; create with parentheses, access by index, iterate in fixed order, and use count and index as primary methods.
Explore sets in Python, a built-in data type with no order and no duplicates, learn operations like add, discard, clear, and pop, and compare with tuples.
Discover how Python string methods like capitalize, title, lower, upper, find, count, and replace work, and learn the distinction between mutating and non-mutating operations.
Explore essential Python number methods and functions, including is_integer on floats, abs for absolute value, pow for powers, and round for precision, with practical examples.
Explore Python dictionaries as key-value stores inside curly braces, with country data like name, population, and capital; access values directly by keys instead of list indices.
Explore how Python dictionaries store key-value pairs with curly braces and colons. Access values by keys, handle key errors, and apply string keys for readability.
Learn how dictionaries support adding keys after creation, access values with bracket notation, and print structured data like a user country with name and population, plus avoid f-string quote pitfalls.
Combine lists and dictionaries to create a list of dictionaries with country data (name and capital), access by index, retrieve name and capital, and print country with the largest population.
Master dictionaries with loops by building a car dictionary and printing keys and values. Discover how Python 3.6 preserves order and how to access values via a variable key.
Loop through a list of dictionaries to access country names and capitals, illustrating dictionaries, lists, and for loops.
Explore a Python grocery purchase solution, updating money on hand, building a cart, and buying items with loops, global usage, and total price calculations.
Explore how Python, a modular language, uses from calc import calc to split code into separate files and import main functionality to build scalable programs.
Explore how Python uses core and third-party modules, import and alias techniques (including using as and pip), with examples like math, pandas, and pygame.
Build a text-based Python RPG with an entry point game.py, using input and f formatting to select actions, and manage data with dictionaries, lists, loops, and modules.
Create a text-based RPG by building a hero dictionary, inventory, and a game loop driven by user input, managing experience, level, gold, attack power, defense, hp, weapon, and health potion.
Refactor by outsourcing the fight into a dictionary-driven options menu and build an enemy dictionary for a zombie with hp, attack, defense, weapon, xp and gold drops, plus berserk power.
Define a fight function to create an enemy and run a fight loop inside the main game loop, using a boolean in_fight to control the inner loop.
Move data and settings to a module to keep game data organized and accessible. Learn to create game_data.py, import it, and access heroes, enemies, and main options with dot notation.
Demonstrates how the random module generates a random number with randint to pick a random enemy from game data, using len(enemies) for the index and adding adjectives.
Refine a Python text-based battle loop by moving data to a separate file, implement attack and defense options, and track health points and potions with damage calculations.
Script battle mechanics with hero and enemy turns, calculating attack minus defense and updating hit points, then awarding gold and experience on victory.
Explore how Python handles mutation, references, and values, distinguishing immutable types from mutable ones, and explain memory references, garbage collection, and pass-by-reference in practice.
Explore how Python handles mutation, reference, and value with id demonstrations, showing immutable ints, mutable lists, and how variables reference shared objects.
Explore how mutation, reference, and value behave in Python functions by examining how modifying a mutable list inside a function affects the original list, while immutable types remain unchanged.
use the copy method to copy the value, not the pointer, creating a new independent variable so you don't mutate the original.
Refactor the fight function into a battle engine module, rename fight to battle engine, and simplify imports. Implement health potion logic and max HP groundwork for future level-ups.
Learn to implement a health potion mechanic in a battle engine by tracking inventory, removing consumed potions, and using a temporary enemy attack modifier within the fight loop.
Extend your Python RPG project by adding features and refining the battle engine, shop, or theme, building concepts on top of concepts with practice.
Explore object oriented programming with classes and objects, contrasting them with procedural code to build scalable, maintainable Python programs using factories and centralized data.
Explore object-oriented concepts by using a class as a blueprint to create hero, goblin, and zombie objects with attributes like HP, name, attack power, and defense power.
learn to define a Python class and instantiate objects using visual studio code, with a focus on proper naming conventions, file organization, and importing classes to create objects.
Define a character class with name and hp and demonstrate class conventions by using dot notation, self as the first parameter, and print name.
Explore how Python resolves name errors in class methods with self for instance data and how __init__ serves as a dunder constructor that initializes objects.
Explore how the __init__ constructor accepts arguments with self as the first parameter and how objects like goblin and zombie use character name and HP.
See how changing object values, like name and hp, stays isolated to each object, so one object's hp changes don't affect others, in a text RPG example.
Build a class based text RPG in Python by creating character and game settings classes, importing modules, and implementing an interactive main loop with user input and object attributes.
Create a game character class with name, exp, level, gold, attack power, defense, max hp, hp, weapon, and inventory, using keyword arguments; test with hero, goblin, and zombie.
Add the battle engine back in by importing a battle engine function and passing enemies and hero as lists of character objects, while refactoring from game data and adjusting imports.
Discover why objects require fresh instances instead of copying dictionaries, preventing shared HP state across battles, and how to instantiate heroes and enemies inside the battle engine.
Explore how inheritance creates hero and monster subclasses from a base character, sharing core attributes while adding monster-specific drops like gold and experience.
Practice Python inheritance syntax by building a base phone class and an iPhone subclass, defining make, model, carrier, operating system, and contacts, and exploring how the init method handles attribute initialization.
Explore how to use super in Python to initialize a subclass, invoking the parent phone class’s __init__ with model, carrier, OS, and contacts to set inherited attributes.
Define an iPhone X class that inherits from iPhone and phone, uses super to initialize, and sets facial id to true while passing model, carrier, and contacts.
Override parent methods in a Python class hierarchy to customize behavior for subclasses like iPhone and iPhone X, demonstrating how the bottom-most method in the chain executes.
Refactor the game code by turning the character class into hero and monster subclasses, moving level, gold, and XP to hero, and implementing hero init via super.
Create a Monster class as a subclass of Character, implement __init__ with exp drop, gold drop, attack, defense, hp, weapon, and a growl method, refactor battle engine to use Monster.
Explore testing subclasses in a class-based text RPG and make adjustments to a Python battle engine by using inheritance, balancing attack, defense, and XP drops for goblin and zombie.
Celebrate mastering core modern Python basics, including classes, inheritance, loops, functions, and conditionals. Recognize how modules and popular libraries like numpy and pandas broaden Python beyond the core.
Develop a centralized take_damage method in the character class that calculates power_hit from attacker attack_power minus defender defense, subtracts from HP, and returns the damage for the battle engine.
Centralize damage calculations in a battle engine by introducing damage and defense modifiers on characters, and apply them during attacks, healing, and potion use.
Create a battle victory method in the hero class and integrate it with the battle engine to grant gold and experience when the foe is vanquished.
Increase a hero’s level by tracking experience thresholds in game settings, then boost attack, defense, and HP while resetting current HP at level-ups, with a level up message.
Learn to improve readability by applying ANSI color codes to terminal output, using a color dictionary in game settings to highlight text and switch back to normal.
Use the time module to pause the game for dramatic effect and print staged dialogue, and leverage the OS module to clear the screen for forest entries, enhancing gameplay.
Fix the shop option and build a shop system using Shop Starter with Dictionary.py, defining items with names, descriptions, and costs, and create a display loop with a leave option.
Learn to iterate over item dictionaries, number each entry, and format name, cost, and description, while using game settings colors to display gold in a Python shop.
Implement a Python shop flow: prompt for item choice, compute the index, verify hero gold against the item cost, and respond with color cues when funds run low.
Implement a shop flow where the hero buys items, leaves the shop, and updates gold, inventory, and equipped weapons, including a magic sword that increases attack power.
Develop a hero shop flow that sets weapon and armor, applies a 15% defense boost, and prints green success messages while simulating attack damage against a zombie.
Define Troll as a monster subclass, move stats into the Troll class, implement init and super calls, and simplify the battle engine by storing data in the class.
Fix the battle engine to end the game when the hero's hp drops to zero, implement fight loop checks, and display thou hast been slain by the troll.
Copy the troll class to create goblin and zombie monsters in the battle engine, updating imports and class names, and prepare for future special powers.
Learn to apply weighted randomness in Python by using random.choice on a preweighted list to spawn goblins, zombies, and trolls, then introduce a dragon boss with variable stats.
Learn how to extend Python beyond core by importing built-in modules and using pip to install third-party packages like pygame, numpy, pandas, and tensorflow for game graphics.
Explore how venv creates isolated virtual environments to manage Python projects, install third-party modules with pip, and keep dependencies separate across projects.
Learn the universal method for installing Python packages globally as a last resort, compare it with virtual environments, and practice installing pygame with pip and undoing it.
Create a virtual environment with python -m venv, then activate it on mac or Windows and use pip to install Pi game inside the environment.
activate the python virtual environment in the Ninjas versus Monsters project on mac or linux by running source ./bin/activate in bash or zsh, then deactivate to exit.
Activate the python virtual environment on Windows using PowerShell, with activate bat or activate ps1 in the scripts folder. Adjust the execution policy to stay within Ninjas versus Monsters.
Verify and install pip inside your virtual environment, install pygame with pip, upgrade pip when needed, and test the setup by importing pygame to confirm successful installation.
Set up and activate a virtual environment, install and import pygame, initialize pygame, and integrate graphics assets from the ninjas versus monsters project to build a pygame game.
Set up the graphics screen with pygame, obtain the screen size via display info, and initialize a game loop that processes events, including the quit event, to shut down gracefully.
Master the pygame game loop: handle events, quit cleanly, draw a background PNG, and update visuals with display.flip and a clock tick to cap frames per second.
Load an image with pygame.image.load, obtain its rect with get_rect, and draw it on the screen using screen.blit at the image's x,y coordinates.
Create a Background class to scale the game background to the screen size using pygame's transform.scale. Pass the screen and size to render a full-screen image with an updated rect.
Define a player class in pygame, load the ninja image, set its rect, and blit it onto a full screen background, preparing to move the blit logic to a function.
Implement an update_screen function to centralize all screen updates, drawing the player and background, moving the player, and managing the screen reference across the game loop.
Move event handling out of the main game loop by creating a new check_events.py function, which returns a dictionary with a game_on key to control quitting and screen updates.
Shrink the hero using transform.scale_by to about 0.35, set its on-screen position with x and y, then listen for the right arrow to move and draw the player.
Move the ninja with the arrow keys by handling pygame key down and key up events in the game loop, updating the player's x and y coordinates to animate movement.
Learn to implement smooth character movement and screen bounds by holding keys, and build a dictionary-driven animation system that loads, scales, and cycles through idle and run image sequences.
Learn how to animate a running character in Python by cycling through run frames and idle states, using a dictionary of image types, index management, and key events.
Learn to implement smooth player movement in Python by using a shouldMove boolean for directions, updating the player's position in the draw function until the key is released.
Implement diagonal movement using boolean flags for up, down, left, and right, handle key down and key up events to update the player's position and switch from idle to run animation.
Animate a ninja by cycling idle and run image sequences, switching images with movement, and syncing animation frames using a tick in the game loop for smooth visuals.
Animate run and flip image in a Python game by updating the character's image type on key presses, flipping the sprite for left movement, and switching between idle and run.
Set borders for player movement by implementing boundary checks in the game loop, using display info and the image rect width to prevent the character from moving off screen.
Learn to implement attack animations in a Python game by handling spacebar input, locking the player during attacks, and triggering attack, dead, and jump states.
Implement a controlled attack sequence using ticks to lock the player in attack for 50 ticks, reset the attack animation, switch to idle after completion, and prevent movement during attack.
Load and integrate troll images to expand ninjas versus monsters, create a monster class, and implement leftward movement and attack logic with assets loaded from a zip.
Define a new image load function to load image types for player and monster with pygame, returning image types and simplifying image loading and refactoring.
Learn to animate and move a troll monster in a Pygame project by loading images, flipping sprites, syncing animation with a tick, and updating the screen.
Master pygame sprites by turning monsters into a Sprite subclass, managing them with a Group for drawing and collision, and adding monsters on a tick to update the screen.
Illustrates optimizing performance by using a class variable to share monster image types across all instances, replacing per-instance image loading and explaining the class vs. instance variable distinction.
Learn to implement group collision detection in pygame by turning the player and monsters into sprites, using sprite collide to detect overlaps, and handling removal, attack logic, and rect-based collisions.
Learn how to implement collision detection in Pygame by syncing sprite rects with x and y positions, updating player and monster rects, and triggering stop and attack animations for trolls.
Explore group collision in a Python game loop by teaching monsters to stop and attack when colliding, and to resume walking after separation, with update screen logic and tick-based spawning.
Add orc and troll images by implementing a troll class, using separate stats lists for trolls and orcs, and organizing image assets in the images folder.
Define a troll class as a pygame monster subclass, load image types, and randomly select a troll variant with hp, speed, and attack stats.
Learn to render a random troll by wiring the troll class to the monster constructor, pulling image types, and staggering entry with random y and current screen height.
Create an orc class by cloning the troll, loading auk images, and using random orc or auk spawns with HP, attack, and speed, while scaling the orc image.
Stop monster bobbing by drawing from the bottom, not the top; adjust self.rect.y by the image height so feet stay fixed, using blit and rect for drawing and collisions.
Implement a take_damage function for monsters and handle player-monster collisions in update_screen with pygame. Manage attack animations, damage, and a left-edge treasure end condition with scoring for defeated monsters.
Add monster.take_damage(player) to reduce health by the player's attack power, switch to hurt if alive, or die and remove the monster, incrementing the player's kill count when health hits zero.
Manage monster states in the update screen: remove dying monsters from the sprite group after their die animation, and switch hurt monsters back to attack once their hurt animation finishes.
Place treasure on left as monsters move toward it; end game if ninja misses, and implement a treasure class as a pygame sprite in a treasures group to track score.
Load treasure images, set them as class variables, and randomly select between pile and vase. Position at 200, 500, scale to 0.3, and render with correct draw order.
Use groupcollide to detect treasure-monster collisions and remove treasures on impact, not monsters; spawn five treasures at random positions, log 'Treasure was taken,' and pause the game on collision.
Return true from the update screen to signal game over and set game on to false, ending the game. Then enable a game over screen loop with a quit event.
Create a reusable pygame game button class that renders text on a colored rectangle, supports font, colors, position, center alignment, and can display a game over message and score.
Add a player score display by creating a game button and rendering the score text using pygame. Update the text whenever monsters are taken down to reflect the player's score.
Welcome to the 10-Day Python Blitz: Your Fast Track to Python Mastery!
Are you ready to embark on an exciting journey into the world of programming? Have you ever wanted to learn Python, one of the most versatile and in-demand programming languages today, but didn't know where to start? Look no further... my comprehensive course, "10-Day Python Blitz," is designed especially for beginners with no prior coding experience.
Why Choose the 10-Day Python Blitz?
I teach concepts by drawing on a board before going to a code editor. It is becoming increasingly important in a world full of AI spam and automation to have a real human as close as possible... especially when you are learning a new (hard) skill. Don't underestimate the power of the old-school ways!
We will code out two different games which are a fun, incredibly effective way to learn how to program. You can be creative and add your own features or just follow me.
The course is divided into 10 easy-to-follow sections, one for each day, about 2 hours of content per day. You can do it at this pace, or you can slow things down, either way you can grasp Python fundamentals gradually. No need to rush; we will keep moving forward but you shouldn't feel overwhelmed.
Hands-On Experience: From lecture 2, you'll be writing Python code. I believe that the best way to learn is by doing, so be prepared to roll up your sleeves and tackle fun coding challenges.
What You'll Learn:
Days 1-3: Python Basics: Start with the fundamentals of Python programming. Learn about variables, data types, lists, and other essential programming concepts.
Days 4: Game Development: We’ll apply what you’ve learned in days 1-3 by making a text-based RPG (no graphics). There’s nothing better than game programming to work on your coding skils.
Days 5: Classes and Objects: We will tackle one of the most important concepts in programming: objects and classes. This will set you up to excel for the rest of the course.
Days 6: Remake of Day 4: We’ll take the same project we made on day 4, but with classes and objects. This is a fantastic way to build confidence in what you’re learning. Instead of focusing on a completely new project, we can focus on applying the principals we’ve just covered, on something that you are familiar with. No more “new concepts.” Just applying what we’ve covered.
Days 7-9: Game Development Part 2: We’ll make another game, but this time we’ll make one that has graphics! This will introduce you to 3rd party modules and, like Day 6, will use everything we’ve covered,
Day 10: Algorithmic Thinking: I’ll challenge you with various algorithms and code challenges. This will give you a chance to apply what you’ve learned in a create and problem-solving manner. Nothing is more valuable than creative application when learning a new skill!
Why Me?
I've been a code instructor since 2014 and an engineer since 2004. I have a special passion for helping people start from scratch and having worked with 100s of learners in person, I have seen and heard all the requests of new students and put them into practice. I use a lightboard to help teach concepts visually. In the world of AI, more and more content is detached and impersonal as you get farther away from a human. This will help you "see" the concepts from a real person!
Why Python?
Python is renowned for its simplicity and readability, making it an ideal choice for beginners. Moreover, it's a language with vast applications, from web development and data analysis to artificial intelligence and automation. Learning Python opens doors to numerous career opportunities. You won’t master it here, but you will get a solid grasp of what it’s capable of and how it works
Join the "10-Day Python Blitz" and take your first step toward a rewarding programming journey. Whether you're looking to boost your career prospects or explore a new hobby, my course will equip you with the skills you need. Don't miss out on this opportunity to become a Python pro in just 10 days. Enroll now and unlock the world of endless possibilities that Python has to offer!