Python tutorials

Concatenating Strings in Python Efficiently

Python string concatenation is a fundamental operation that combines multiple strings into a single string. In Python, you can concatenate strings using the + operator or append them with +=. For more efficient concatenation, especially when working with lists of strings, the .join() method is recommended. Other techniques include using StringIO for large datasets and the print() function for quick screen output. By the end of this video course, you’ll understand that you can: Concatenate strings in Python using the […]

Read more

Python News Roundup: February 2025

The new year has brought a flurry of activity to the Python community. New bugfix releases of Python 3.12 and 3.13 show that the developers seemingly never sleep. A new type of interpreter is slated for the upcoming Python 3.14 as part of ongoing efforts to improve Python’s performance. Poetry takes a giant leap toward compatibilty with other project management tools with the release of version 2. If you’re interested in challenging yourself with some programming puzzles, check out the […]

Read more

Quiz: Python Keywords: An Introduction

Interactive Quiz ⋅ 6 QuestionsBy Philipp Acsany Share In this quiz, you’ll test your understanding of Python Keywords. Python keywords are reserved words with specific functions and restrictions in the language. These keywords are always available in Python, which means you don’t need to import them. Understanding how to use them correctly is fundamental for building Python programs. The quiz contains 6 questions and there is no time limit. You’ll get 1 point for each correct answer. At the end […]

Read more

Python Keywords: An Introduction

Watch Now This tutorial has a related video course created by the Real Python team. Watch it together with the written tutorial to deepen your understanding: Exploring Keywords in Python Python keywords are reserved words with specific functions and restrictions in the language. Currently, Python has thirty-five keywords and four soft keywords. These keywords are always available in Python, which means you don’t need to import them. Understanding how to use them correctly is fundamental for building Python programs. By […]

Read more

Building a Python Command-Line To-Do App With Typer

Building an application to manage your to-do list can be an interesting project when you’re learning a new programming language or trying to take your skills to the next level. In this video course, you’ll build a functional to-do application for the command line using Python and Typer, which is a relatively young library for creating powerful command-line interface (CLI) applications in almost no time. With a project like this, you’ll apply a wide set of core programming skills while […]

Read more

How to Join Strings in Python

Python’s built-in string method .join() lets you combine string elements from an iterable into a single string, using a separator that you specify. You call .join() on the separator, passing the iterable of strings to join. By the end of this tutorial, you’ll understand that: You use .join() in Python to combine string elements with a specified separator. A separator is the piece of text you want inserted between each substring. To join list elements, you call .join() on a […]

Read more

Quiz: How to Join Strings in Python

Interactive Quiz ⋅ 12 QuestionsBy Martin Breuss Share In this quiz, you’ll test your understanding of How to Join Strings in Python. By working through this quiz, you’ll review how to use .join() to combine strings with a specified separator and handle non-string data in iterables. You’ll also revisit how .join() compares to other concatenation methods and how it’s optimized in CPython. The quiz contains 12 questions and there is no time limit. You’ll get 1 point for each correct […]

Read more

Quiz: Python “for” Loops: The Pythonic Way

Interactive Quiz ⋅ 11 QuestionsBy Leodanis Pozo Ramos Share In this quiz, you’ll test your understanding of Python’s for loop. By working through this quiz, you’ll revisit how to iterate over items in a data collection, how to use range() for a predefined number of iterations, and how to use enumerate() for index-based iteration. The quiz contains 11 questions and there is no time limit. You’ll get 1 point for each correct answer. At the end of the quiz, you’ll […]

Read more

Quiz: How to Split a String in Python

Interactive Quiz ⋅ 9 QuestionsBy Martin Breuss Share In this quiz, you’ll test your understanding of Python’s .split() method. Python’s .split() method lets you divide a string into a list of substrings based on a specified delimiter. By default, .split() separates at whitespace, including spaces, tabs, and newlines. You can customize .split() to work with specific delimiters using the sep parameter, and control the amount of splits with maxsplit. The quiz contains 9 questions and there is no time limit. […]

Read more

How to Split a String in Python

Python’s .split() method lets you divide a string into a list of substrings based on a specified delimiter. By default, .split() separates at whitespace, including spaces, tabs, and newlines. You can customize .split() to work with specific delimiters using the sep parameter, and control the amount of splits with maxsplit. By the end of this tutorial, you’ll understand that: You split a string by spaces in Python using .split() without arguments. Python’s .split() method can split on custom delimiters when […]

Read more
1 2 3 185