Python tutorials

Quiz: Structuring Your Python Script

Interactive Quiz ⋅ 8 QuestionsBy Joseph Peart Share In this quiz, you’ll test your understanding of the video course Structuring Your Python Script. By working through this quiz, you’ll revisit how to make a Python script executable with a shebang, organize your imports per PEP 8, automatically sort imports with ruff, and define a clear entry point using if __name__ == “__main__”. These habits help you transition from quick experiments in the REPL to writing Python scripts that are easy […]

Read more

Quiz: Python’s Format Mini-Language for Tidy Strings

Interactive Quiz ⋅ 12 QuestionsBy Joseph Peart Share In this quiz, you’ll test your understanding of Python’s Format Mini-Language for Tidy Strings. By working through this quiz, you’ll revisit how format specifiers work inside f-strings and str.format(), including alignment and width fields, decimal precision, type representations, thousand separators, sign handling, dynamic specifiers, and percentage formatting. The quiz contains 12 questions and there is no time limit. You’ll get 1 point for each correct answer. At the end of the quiz, […]

Read more

Structuring Your Python Script

You may have begun your Python journey interactively, exploring ideas within Jupyter Notebooks or through the Python REPL. While that’s great for quick experimentation and immediate feedback, you’ll likely find yourself saving code into .py files. However, as your codebase grows, knowing where things should go in your script becomes increasingly important. Transitioning from interactive environments to structured scripts helps promote readability, enabling better collaboration and more robust development practices. This video course shows you the foundations of organizing a […]

Read more

Quiz: Regular Expressions: Regexes in Python (Part 1)

Interactive Quiz ⋅ 10 QuestionsBy Joseph Peart Share In this quiz, you’ll test your understanding of Regular Expressions: Regexes in Python (Part 1). By working through this quiz, you’ll revisit how to use the re module to search for patterns, build character classes and anchors, group and capture substrings, and apply flags like re.IGNORECASE to control matching behavior. The quiz contains 10 questions and there is no time limit. You’ll get 1 point for each correct answer. At the end […]

Read more

Python sleep(): How to Add Time Delays to Your Code

Sometimes you need to make Python sleep, wait, or pause before running the next line of code. Whether you’re spacing out API requests, pacing a thread, or adding a delay to terminal output, Python’s time.sleep() function is the standard tool: from time import sleep sleep(3) # Pause execution for 3 seconds Beyond time.sleep(), Python provides different ways to add time delays depending on the context, including threads, async code, and GUI applications. By the end of this tutorial,    

Read more

Quiz: Python’s assert: Debug and Test Your Code Like a Pro

Interactive Quiz ⋅ 10 QuestionsBy Joseph Peart Share In this quiz, you’ll test your understanding of Python’s assert: Debug and Test Your Code Like a Pro. By working through this quiz, you’ll revisit how assertions help you debug, test, and document your code, when to disable them in production, and which common pitfalls to avoid. The quiz contains 10 questions and there is no time limit. You’ll get 1 point for each correct answer. At the end of the quiz, […]

Read more

Quiz: Visualizing Data in Python With Seaborn

Interactive Quiz ⋅ 10 QuestionsBy Joseph Peart Share In this quiz, you’ll test your understanding of Visualizing Data in Python With Seaborn. By working through this quiz, you’ll revisit how seaborn produces polished statistical plots, including bar plots, scatter plots, line plots, histograms, and KDE curves. You’ll also reinforce the differences between seaborn’s classic functional interface and its newer objects interface, and you’ll see when to reach for figure-level versus axes-level functions. The quiz contains 10 questions and there is […]

Read more

Quiz: BNF Notation: Dive Deeper Into Python’s Grammar

Interactive Quiz ⋅ 10 QuestionsBy Joseph Peart Share In this quiz, you’ll test your understanding of BNF Notation: Dive Deeper Into Python’s Grammar. By working through this quiz, you’ll revisit how to read Python’s grammar rules, recognize terminals and nonterminals, and interpret the BNF fragments that appear throughout the official documentation. The quiz contains 10 questions and there is no time limit. You’ll get 1 point for each correct answer. At the end of the quiz, you’ll receive a total […]

Read more
1 2 3 225