HTTP/2 301
date: Tue, 30 Dec 2025 21:58:51 GMT
content-type: text/html; charset=utf-8
content-length: 0
cross-origin-opener-policy: same-origin
location: /courses/idiomatic-python-101/
nel: {"report_to":"heroku-nel","response_headers":["Via"],"max_age":3600,"success_fraction":0.01,"failure_fraction":0.1}
referrer-policy: strict-origin-when-cross-origin
report-to: {"group":"heroku-nel","endpoints":[{"url":"https://nel.heroku.com/reports?s=2fwmqXN8BqXKguPvAIVl2Tr5tGlk1pg7V%2FZviQ3JlYE%3D\u0026sid=67ff5de4-ad2b-4112-9289-cf96be89efed\u0026ts=1767131931"}],"max_age":3600}
reporting-endpoints: heroku-nel="https://nel.heroku.com/reports?s=2fwmqXN8BqXKguPvAIVl2Tr5tGlk1pg7V%2FZviQ3JlYE%3D&sid=67ff5de4-ad2b-4112-9289-cf96be89efed&ts=1767131931"
server: cloudflare
set-cookie: cid=66e9b32961c5450ab03cc8ece78d48d4; expires=Wed, 30 Dec 2026 21:58:51 GMT; Max-Age=31536000; Path=/
strict-transport-security: max-age=31536000; includeSubDomains; preload
vary: Cookie
via: 2.0 heroku-router
x-content-type-options: nosniff
cf-cache-status: DYNAMIC
cf-ray: 9b64cd083b91c7d4-BLR
alt-svc: h3=":443"; ma=86400
HTTP/2 301
date: Tue, 30 Dec 2025 21:58:51 GMT
content-type: text/html; charset=utf-8
content-length: 0
cross-origin-opener-policy: same-origin
location: /courses/writing-idiomatic-python/
nel: {"report_to":"heroku-nel","response_headers":["Via"],"max_age":3600,"success_fraction":0.01,"failure_fraction":0.1}
referrer-policy: strict-origin-when-cross-origin
report-to: {"group":"heroku-nel","endpoints":[{"url":"https://nel.heroku.com/reports?s=2fwmqXN8BqXKguPvAIVl2Tr5tGlk1pg7V%2FZviQ3JlYE%3D\u0026sid=67ff5de4-ad2b-4112-9289-cf96be89efed\u0026ts=1767131931"}],"max_age":3600}
reporting-endpoints: heroku-nel="https://nel.heroku.com/reports?s=2fwmqXN8BqXKguPvAIVl2Tr5tGlk1pg7V%2FZviQ3JlYE%3D&sid=67ff5de4-ad2b-4112-9289-cf96be89efed&ts=1767131931"
server: cloudflare
set-cookie: origin=ref-realpython.com; expires=Sun, 24 Sep 2028 21:58:51 GMT; Max-Age=86313600; Path=/
strict-transport-security: max-age=31536000; includeSubDomains; preload
vary: Cookie
via: 2.0 heroku-router
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
cf-cache-status: DYNAMIC
cf-ray: 9b64cd09bba3c7d4-BLR
alt-svc: h3=":443"; ma=86400
HTTP/2 200
date: Tue, 30 Dec 2025 21:58:51 GMT
content-type: text/html; charset=utf-8
cross-origin-opener-policy: same-origin
nel: {"report_to":"heroku-nel","response_headers":["Via"],"max_age":3600,"success_fraction":0.01,"failure_fraction":0.1}
referrer-policy: strict-origin-when-cross-origin
report-to: {"group":"heroku-nel","endpoints":[{"url":"https://nel.heroku.com/reports?s=2fwmqXN8BqXKguPvAIVl2Tr5tGlk1pg7V%2FZviQ3JlYE%3D\u0026sid=67ff5de4-ad2b-4112-9289-cf96be89efed\u0026ts=1767131931"}],"max_age":3600}
reporting-endpoints: heroku-nel="https://nel.heroku.com/reports?s=2fwmqXN8BqXKguPvAIVl2Tr5tGlk1pg7V%2FZviQ3JlYE%3D&sid=67ff5de4-ad2b-4112-9289-cf96be89efed&ts=1767131931"
server: cloudflare
set-cookie: csrftoken=3KaodsHNewjsnQZzvaxLrpKwRGEJAnIm; expires=Tue, 29 Dec 2026 21:58:51 GMT; Max-Age=31449600; Path=/; SameSite=Lax; Secure
strict-transport-security: max-age=31536000; includeSubDomains; preload
vary: Cookie, Accept-Encoding
via: 2.0 heroku-router
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
cf-cache-status: DYNAMIC
content-encoding: gzip
cf-ray: 9b64cd0b0bc1c7d4-BLR
alt-svc: h3=":443"; ma=86400
Writing Idiomatic Python – Real Python
Writing Idiomatic Python
What programming idioms are unique to Python? This course is both a short overview for people coming from other languages as well as an introduction for programming beginners to the idiomatic practices within Python.
In this course, you’ll learn:
How to access and interpret The Zen of Python
How to set up a script
How to test truth values
How to swap variables in-place
How to create Pythonic for loops
What’s Included:
Downloadable Resources:
Related Learning Paths:
Martin is Real Python's Head of Content Strategy. With a background in education, he's worked as a coding mentor, code reviewer, curriculum developer, bootcamp instructor, and instructional designer.
» More about Martin
Each tutorial at Real Python is created by a team of developers so that it meets our high quality standards. The team members who worked on this tutorial are:
← Browse All Courses
Get a Python Cheat Sheet (PDF) and learn the basics of Python, like working with data types, dictionaries, lists, and Python functions: