I/O Operations and String Formatting
Learning Path ⋅ Skills: Python, Fundamentals, I/O, String Formatting
Master Python’s input, output, and string formatting with our comprehensive path. Learn keyboard input, integer handling, and advanced print techniques. Dive into modern string formatting with f-strings and the format mini-language. Perfect for enhancing your Python coding skills!
I/O Operations and String Formatting
Learning Path ⋅ 8 Resources
Course
Reading Input and Writing Output in Python
In this introductory Python course, you'll learn how to take user input from the keyboard with the built-in function input() and how to display output to the console with the built-in function print().
Tutorial
How to Read User Input From the Keyboard in Python
Reading user input from the keyboard is a valuable skill for a Python programmer, and you can create interactive and advanced programs that run on the terminal. In this tutorial, you'll learn how to create robust user input programs, integrating error handling and multiple entries.
Tutorial
How to Read Python Input as Integers
Learn how to use Python to get integer input from the user while handling any errors resulting from non-numeric input. This will involve coding your own reusable function built around input().
Course
The Python print() Function: Go Beyond the Basics
Learn about the print() function in Python and discover some of its lesser-known features. Avoid common mistakes, take your "hello world" to the next level, and know when to use a better alternative.
Interactive Quiz
The Python print() Function
Course
Formatting Python Strings
See two items to add to your Python string formatting toolkit. You'll learn about Python's string format method and the formatted string literal, or f-string. You'll learn about these formatting techniques in detail and add them to your Python string formatting toolkit.
Interactive Quiz
A Guide to Modern Python String Formatting Tools
Course
Python 3's F-Strings: An Improved String Formatting Syntax
As of Python 3.6, f-strings are a great new way to format strings. Not only are they more readable, more concise, and less prone to error than other ways of formatting, but they are also faster! By the end of this course, you'll know how and why to start using f-strings today.
Interactive Quiz
Python F-Strings
Course
Formatting Floats Inside Python F-Strings
Learn how to use Python format specifiers within an f-string to allow you to neatly format a float to your required precision.
Interactive Quiz
Format Floats Within F-Strings
Tutorial
Python's Format Mini-Language for Tidy Strings
Learn about Python's format mini-language. You'll learn how to use the mini-language to create working format specifiers and build nicely formatted strings and messages in your code.
Got feedback on this learning path?
Looking for real-time conversation? Visit the Real Python Community Chat or join the next “Office Hours” Live Q&A Session. Happy Pythoning!