René's URL Explorer Experiment


Title: Using Python Optional Arguments When Defining Functions – Real Python

Open Graph Title: Using Python Optional Arguments When Defining Functions – Real Python

Description: Learn to use Python's optional arguments to handle variable inputs. Build flexible functions and avoid common errors when setting defaults.

Open Graph Description: Learn to use Python's optional arguments to handle variable inputs. Build flexible functions and avoid common errors when setting defaults.

Mail addresses
?subject=Python article for you&body=Using Python Optional Arguments When Defining Functions on Real Python https://realpython.com/python-optional-arguments/

Opengraph URL: https://realpython.com/python-optional-arguments/

X: @realpython

direct link

Domain: realpython.com


Hey, it has json ld scripts:
{
  "@context": "http://schema.org",
  "@type": "Article",
  "headline": "Using Python Optional Arguments When Defining Functions",
  "image": {
    "@type": "ImageObject",
    "url": "https://files.realpython.com/media/How-to-Create-Python-Functions-with-Optional-Arguments_Watermarked.f2c8b582aff0.jpg",
    "width": 1920,
    "height": 1080
  },
  "mainEntityOfPage": {
    "@type": "WebPage",
    "@id": "https://realpython.com/python-optional-arguments/",
    "lastReviewed": "2025-10-27",
    "author": {
      "@type": "Person",
      "name": "Stephen Gruppetta",
      "image": "https://realpython.com/cdn-cgi/image/width=400,height=400,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/Stephen_inside_2_BW_2_square_crop_2_low_res_2_copy.4a7e2d8bc19c.png",
      "url": "https://realpython.com/team/sgruppetta/",
      "affiliation": {
        "@type": "Organization",
        "@id": "https://realpython.com/#organization",
        "name": "Real Python",
        "url": "https://realpython.com",
        "logo": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png"
      }
    },
    "reviewedBy": [
      {
        "@type": "Person",
        "name": "Aldren Santos",
        "image": "https://realpython.com/cdn-cgi/image/width=500,height=500,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/Aldren_Santos_Real_Python.6b0861d8b841.png",
        "url": "https://realpython.com/team/asantos/",
        "affiliation": {
          "@type": "Organization",
          "@id": "https://realpython.com/#organization",
          "name": "Real Python",
          "url": "https://realpython.com",
          "logo": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png"
        }
      },
      {
        "@type": "Person",
        "name": "Bartosz Zaczy\u0144ski",
        "image": "https://realpython.com/cdn-cgi/image/width=1694,height=1694,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/coders_lab_2109368.259b1599fbee.jpg",
        "url": "https://realpython.com/team/bzaczynski/",
        "affiliation": {
          "@type": "Organization",
          "@id": "https://realpython.com/#organization",
          "name": "Real Python",
          "url": "https://realpython.com",
          "logo": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png"
        }
      },
      {
        "@type": "Person",
        "name": "Joanna Jablonski",
        "image": "https://realpython.com/cdn-cgi/image/width=800,height=800,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/jjablonksi-avatar.e37c4f83308e.jpg",
        "url": "https://realpython.com/team/jjablonski/",
        "affiliation": {
          "@type": "Organization",
          "@id": "https://realpython.com/#organization",
          "name": "Real Python",
          "url": "https://realpython.com",
          "logo": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png"
        }
      },
      {
        "@type": "Person",
        "name": "Jacob Schmitt",
        "image": "https://realpython.com/cdn-cgi/image/width=400,height=400,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/profile-small_js.2f4d0d8da1ca.jpg",
        "url": "https://realpython.com/team/jschmitt/",
        "affiliation": {
          "@type": "Organization",
          "@id": "https://realpython.com/#organization",
          "name": "Real Python",
          "url": "https://realpython.com",
          "logo": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png"
        }
      },
      {
        "@type": "Person",
        "name": "Leodanis Pozo Ramos",
        "image": "https://realpython.com/cdn-cgi/image/width=862,height=862,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/Perfil_final1.9f896bc212f6.jpg",
        "url": "https://realpython.com/team/lpozoramos/",
        "affiliation": {
          "@type": "Organization",
          "@id": "https://realpython.com/#organization",
          "name": "Real Python",
          "url": "https://realpython.com",
          "logo": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png"
        }
      },
      {
        "@type": "Person",
        "name": "Martin Breuss",
        "image": "https://realpython.com/cdn-cgi/image/width=456,height=456,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/martin_breuss_python_square.efb2b07faf9f.jpg",
        "url": "https://realpython.com/team/mbreuss/",
        "affiliation": {
          "@type": "Organization",
          "@id": "https://realpython.com/#organization",
          "name": "Real Python",
          "url": "https://realpython.com",
          "logo": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png"
        }
      }
    ]
  },
  "datePublished": "2025-10-27T14:00:00+00:00",
  "dateModified": "2025-10-27T14:09:22.730538+00:00",
  "publisher": {
    "@type": "Organization",
    "@id": "https://realpython.com/#organization",
    "name": "Real Python",
    "url": "https://realpython.com",
    "logo": {
      "@type": "ImageObject",
      "url": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png",
      "width": 512,
      "height": 512
    },
    "description": "Real Python is a leading provider of online Python education and one of the largest language-specific online communities for software developers. It publishes high-quality learning resources, such as tutorials, books, and courses to an audience of millions of developers, data scientists, and machine learning engineers each month.",
    "slogan": "Become a Python Expert",
    "email": "info@realpython.com",
    "sameAs": [
      "https://github.com/realpython",
      "https://www.youtube.com/realpython",
      "https://twitter.com/realpython",
      "https://x.com/realpython",
      "https://www.linkedin.com/company/realpython-com/",
      "https://www.facebook.com/learnrealpython",
      "https://www.instagram.com/realpython",
      "https://www.tiktok.com/@realpython.com"
    ]
  },
  "author": {
    "@type": "Person",
    "name": "Stephen Gruppetta",
    "image": "https://realpython.com/cdn-cgi/image/width=400,height=400,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/Stephen_inside_2_BW_2_square_crop_2_low_res_2_copy.4a7e2d8bc19c.png",
    "url": "https://realpython.com/team/sgruppetta/",
    "affiliation": {
      "@type": "Organization",
      "@id": "https://realpython.com/#organization",
      "name": "Real Python",
      "url": "https://realpython.com",
      "logo": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png"
    }
  },
  "description": "Learn to use Python's optional arguments to handle variable inputs. Build flexible functions and avoid common errors when setting defaults.",
  "hasPart": {
    "@type": "FAQPage",
    "mainEntity": [
      {
        "@type": "Question",
        "name": "What is the difference between parameters and arguments in Python functions?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "

You define parameters when you write a function, and you provide arguments when you call it. Parameters are names inside the function definition, while arguments are the actual values you pass in.

" } }, { "@type": "Question", "name": "Why should you avoid using mutable default arguments like lists or dictionaries?", "acceptedAnswer": { "@type": "Answer", "text": "

You should avoid mutable defaults because Python reuses the same object across calls. This can lead to unexpected behavior when changes persist between function calls.

" } }, { "@type": "Question", "name": "How do args and kwargs make functions more flexible?", "acceptedAnswer": { "@type": "Answer", "text": "

You use *args to accept any number of positional arguments and **kwargs to accept any number of keyword arguments. This makes your functions flexible because they can handle inputs of varying size without rewriting code.

" } }, { "@type": "Question", "name": "What happens if you misorder required and optional parameters in a function definition?", "acceptedAnswer": { "@type": "Answer", "text": "

If you place a parameter with a default value before one without, then Python raises a SyntaxError. Required parameters must always come before optional ones.

" } }, { "@type": "Question", "name": "When should you use None as a default value instead of a mutable object?", "acceptedAnswer": { "@type": "Answer", "text": "

You use None when you want to create a new object inside the function each time it runs. This prevents functions from sharing the same mutable default object between calls.

" } } ] } }

authorReal Python
twitter:cardsummary_large_image
twitter:imagehttps://files.realpython.com/media/How-to-Create-Python-Functions-with-Optional-Arguments_Watermarked.f2c8b582aff0.jpg
og:imagehttps://files.realpython.com/media/How-to-Create-Python-Functions-with-Optional-Arguments_Watermarked.f2c8b582aff0.jpg
twitter:creator@realpython
og:typearticle

Links:

https://realpython.com/
Start Herehttps://realpython.com/start-here/
Learn Python https://realpython.com/python-optional-arguments/
Python Tutorials →In-depth articles and video courseshttps://realpython.com/search?kind=article&kind=course&order=newest
Learning Paths →Guided study plans for accelerated learninghttps://realpython.com/learning-paths/
Quizzes & Exercises →Check your learning progresshttps://realpython.com/quizzes/
Browse Topics →Focus on a specific area or skill levelhttps://realpython.com/tutorials/all/
Community Chat →Learn with other Pythonistashttps://realpython.com/community/
Office Hours →Live Q&A calls with Python expertshttps://realpython.com/office-hours/
Podcast →Hear what’s new in the world of Pythonhttps://realpython.com/podcasts/rpp/
Books →Round out your knowledge and learn offlinehttps://realpython.com/products/books/
Reference →Concise definitions for common Python termshttps://realpython.com/ref/
Code Mentor →BetaPersonalized code assistance & learning toolshttps://realpython.com/mentor/
Unlock All Content →https://realpython.com/account/join/
More https://realpython.com/python-optional-arguments/
Learner Storieshttps://realpython.com/learner-stories/
Python Newsletterhttps://realpython.com/newsletter/
Python Job Boardhttps://www.pythonjobshq.com
Meet the Teamhttps://realpython.com/team/
Become a Tutorial Writerhttps://realpython.com/write-for-us/
Become a Video Instructorhttps://realpython.com/become-an-instructor/
Searchhttps://realpython.com/search
https://realpython.com/search
Joinhttps://realpython.com/account/join/
Sign‑Inhttps://realpython.com/account/login/?next=%2Fpython-optional-arguments%2F
Browse Topicshttps://realpython.com/tutorials/all/
Guided Learning Pathshttps://realpython.com/learning-paths/
Basicshttps://realpython.com/search?level=basics
Intermediatehttps://realpython.com/search?level=intermediate
Advancedhttps://realpython.com/search?level=advanced
aihttps://realpython.com/tutorials/ai/
algorithmshttps://realpython.com/tutorials/algorithms/
apihttps://realpython.com/tutorials/api/
best-practiceshttps://realpython.com/tutorials/best-practices/
careerhttps://realpython.com/tutorials/career/
communityhttps://realpython.com/tutorials/community/
databaseshttps://realpython.com/tutorials/databases/
data-sciencehttps://realpython.com/tutorials/data-science/
data-structureshttps://realpython.com/tutorials/data-structures/
data-vizhttps://realpython.com/tutorials/data-viz/
devopshttps://realpython.com/tutorials/devops/
djangohttps://realpython.com/tutorials/django/
dockerhttps://realpython.com/tutorials/docker/
editorshttps://realpython.com/tutorials/editors/
flaskhttps://realpython.com/tutorials/flask/
front-endhttps://realpython.com/tutorials/front-end/
gamedevhttps://realpython.com/tutorials/gamedev/
guihttps://realpython.com/tutorials/gui/
machine-learninghttps://realpython.com/tutorials/machine-learning/
newshttps://realpython.com/tutorials/news/
numpyhttps://realpython.com/tutorials/numpy/
projectshttps://realpython.com/tutorials/projects/
pythonhttps://realpython.com/tutorials/python/
stdlibhttps://realpython.com/tutorials/stdlib/
testinghttps://realpython.com/tutorials/testing/
toolshttps://realpython.com/tutorials/tools/
web-devhttps://realpython.com/tutorials/web-dev/
web-scrapinghttps://realpython.com/tutorials/web-scraping/
Table of Contentshttps://realpython.com/python-optional-arguments/#toc
Creating Functions in Python for Reusing Codehttps://realpython.com/python-optional-arguments/#creating-functions-in-python-for-reusing-code
Defining Functions With No Input Parametershttps://realpython.com/python-optional-arguments/#defining-functions-with-no-input-parameters
Defining Functions With Required Input Argumentshttps://realpython.com/python-optional-arguments/#defining-functions-with-required-input-arguments
Using Python Optional Arguments With Default Valueshttps://realpython.com/python-optional-arguments/#using-python-optional-arguments-with-default-values
Default Values Assigned to Input Parametershttps://realpython.com/python-optional-arguments/#default-values-assigned-to-input-parameters
Common Default Argument Valueshttps://realpython.com/python-optional-arguments/#common-default-argument-values
Data Types That Shouldn’t Be Used as Default Argumentshttps://realpython.com/python-optional-arguments/#data-types-that-shouldnt-be-used-as-default-arguments
Error Messages Related to Input Argumentshttps://realpython.com/python-optional-arguments/#error-messages-related-to-input-arguments
Using args and kwargshttps://realpython.com/python-optional-arguments/#using-args-and-kwargs
Functions Accepting Any Number of Argumentshttps://realpython.com/python-optional-arguments/#functions-accepting-any-number-of-arguments
Functions Accepting Any Number of Keyword Argumentshttps://realpython.com/python-optional-arguments/#functions-accepting-any-number-of-keyword-arguments
Conclusionhttps://realpython.com/python-optional-arguments/#conclusion
Frequently Asked Questionshttps://realpython.com/python-optional-arguments/#frequently-asked-questions
https://realpython.com/feedback/survey/article/python-optional-arguments/liked/?from=article-sidebar
https://realpython.com/feedback/survey/article/python-optional-arguments/disliked/?from=article-sidebar
Defining Python Functions With Optional Argumentshttps://realpython.com/courses/defining-python-functions-with-optional-arguments/
Stephen Gruppettahttps://realpython.com/python-optional-arguments/#author
https://realpython.com/python-optional-arguments/#reader-comments
basicshttps://realpython.com/tutorials/basics/
pythonhttps://realpython.com/tutorials/python/
Creating Functions in Python for Reusing Codehttps://realpython.com/python-optional-arguments/#creating-functions-in-python-for-reusing-code
Defining Functions With No Input Parametershttps://realpython.com/python-optional-arguments/#defining-functions-with-no-input-parameters
Defining Functions With Required Input Argumentshttps://realpython.com/python-optional-arguments/#defining-functions-with-required-input-arguments
Using Python Optional Arguments With Default Valueshttps://realpython.com/python-optional-arguments/#using-python-optional-arguments-with-default-values
Default Values Assigned to Input Parametershttps://realpython.com/python-optional-arguments/#default-values-assigned-to-input-parameters
Common Default Argument Valueshttps://realpython.com/python-optional-arguments/#common-default-argument-values
Data Types That Shouldn’t Be Used as Default Argumentshttps://realpython.com/python-optional-arguments/#data-types-that-shouldnt-be-used-as-default-arguments
Error Messages Related to Input Argumentshttps://realpython.com/python-optional-arguments/#error-messages-related-to-input-arguments
Using args and kwargshttps://realpython.com/python-optional-arguments/#using-args-and-kwargs
Functions Accepting Any Number of Argumentshttps://realpython.com/python-optional-arguments/#functions-accepting-any-number-of-arguments
Functions Accepting Any Number of Keyword Argumentshttps://realpython.com/python-optional-arguments/#functions-accepting-any-number-of-keyword-arguments
Conclusionhttps://realpython.com/python-optional-arguments/#conclusion
Frequently Asked Questionshttps://realpython.com/python-optional-arguments/#frequently-asked-questions
Remove adshttps://realpython.com/account/join/
Defining Python Functions With Optional Argumentshttps://realpython.com/courses/defining-python-functions-with-optional-arguments/
defining functionshttps://realpython.com/defining-your-own-python-function/
argumentshttps://realpython.com/ref/glossary/argument/
Click here to download the free sample codehttps://realpython.com/bonus/python-optional-arguments-code/
https://realpython.com/quizzes/python-optional-arguments/
Using Python Optional Arguments When Defining Functionshttps://realpython.com/quizzes/python-optional-arguments/
https://realpython.com/python-optional-arguments/#creating-functions-in-python-for-reusing-code
functionhttps://realpython.com/ref/glossary/function/
PEP 8https://realpython.com/ref/glossary/pep-8/
Remove adshttps://realpython.com/account/join/
https://realpython.com/python-optional-arguments/#defining-functions-with-no-input-parameters
prints it outhttps://realpython.com/python-print/
Python scripthttps://realpython.com/python-script-structure/
dictionaryhttps://realpython.com/python-dicts/
define a functionhttps://docs.python.org/3/tutorial/controlflow.html#defining-functions
run this scripthttps://realpython.com/run-python-scripts/
parametershttps://realpython.com/ref/glossary/parameter/
scopehttps://realpython.com/ref/glossary/scope/
Python Scope & the LEGB Rule: Resolving Names in Your Codehttps://realpython.com/python-scope-legb-rule/
Using and Creating Global Variables in Your Python Functionshttps://realpython.com/python-use-global-variable-in-function/
https://realpython.com/python-optional-arguments/#defining-functions-with-required-input-arguments
iterates through the dictionary’s keyshttps://realpython.com/iterate-through-dictionary-python/
run this scripthttps://realpython.com/run-python-scripts/
parametershttps://realpython.com/ref/glossary/parameter/
argumentshttps://realpython.com/ref/glossary/argument/
tracebackhttps://realpython.com/python-traceback/
Remove adshttps://realpython.com/account/join/
https://realpython.com/python-optional-arguments/#using-python-optional-arguments-with-default-values
argumenthttps://realpython.com/ref/glossary/argument/
https://realpython.com/python-optional-arguments/#default-values-assigned-to-input-parameters
parameterhttps://realpython.com/ref/glossary/parameter/
refactorhttps://realpython.com/python-refactoring/
Boolean valuehttps://realpython.com/python-boolean/
https://realpython.com/python-optional-arguments/#common-default-argument-values
integerhttps://realpython.com/python-numbers/#integers
stringhttps://realpython.com/python-strings/
if statementhttps://realpython.com/python-conditional-statements/
Truehttps://realpython.com/ref/keywords/true/
Falsehttps://realpython.com/ref/keywords/false/
Python Booleans: Use Truth Values in Your Codehttps://realpython.com/python-boolean/
Nonehttps://realpython.com/null-in-python/
Remove adshttps://realpython.com/account/join/
https://realpython.com/python-optional-arguments/#data-types-that-shouldnt-be-used-as-default-arguments
data typeshttps://realpython.com/python-data-types/
mutable objecthttps://realpython.com/ref/glossary/mutable/
listhttps://realpython.com/python-list/
Python’s Mutable vs Immutable Types: What’s the Difference?https://realpython.com/python-mutable-vs-immutable-types/
Immutability in Pythonhttps://realpython.com/courses/immutability-python/
Python’s official documentationhttps://docs.python.org/3/library/stdtypes.html#typesseq-immutable
scopehttps://realpython.com/python-namespaces-scope/
return statementhttps://realpython.com/python-return-statement/
assignhttps://realpython.com/python-assignment-operator/
Remove adshttps://realpython.com/account/join/
https://realpython.com/python-optional-arguments/#error-messages-related-to-input-arguments
What Are Python Asterisk and Slash Special Parameters For?https://realpython.com/python-asterisk-and-slash-special-parameters/
https://realpython.com/python-optional-arguments/#using-args-and-kwargs
argshttps://realpython.com/ref/glossary/args/
kwargshttps://realpython.com/ref/glossary/kwargs/
explore args and kwargshttps://realpython.com/python-kwargs-and-args/
https://realpython.com/python-optional-arguments/#functions-accepting-any-number-of-arguments
unpacking operatorhttps://docs.python.org/3/tutorial/controlflow.html#unpacking-argument-lists
Python REPLhttps://realpython.com/python-repl/
print()https://realpython.com/ref/builtin-functions/print/
sequencehttps://realpython.com/ref/glossary/sequence/
define your own functionshttps://realpython.com/defining-your-own-python-function/
REPLhttps://realpython.com/ref/glossary/repl/
tuplehttps://realpython.com/python-tuple/
for loophttps://realpython.com/python-for-loop/
Remove adshttps://realpython.com/account/join/
https://realpython.com/python-optional-arguments/#functions-accepting-any-number-of-keyword-arguments
positional-only argumentshttps://realpython.com/defining-your-own-python-function/#positional-only-arguments
keyword-only argumentshttps://realpython.com/defining-your-own-python-function/#keyword-only-arguments
mappinghttps://realpython.com/ref/glossary/mapping/
mappinghttps://realpython.com/python-mappings/
Python args and kwargs: Demystifiedhttps://realpython.com/python-kwargs-and-args/
Defining Your Own Python Functionhttps://realpython.com/defining-your-own-python-function/#keyword-only-arguments
https://realpython.com/python-optional-arguments/#conclusion
Click here to download the free sample codehttps://realpython.com/bonus/python-optional-arguments-code/
Remove adshttps://realpython.com/account/join/
https://realpython.com/python-optional-arguments/#frequently-asked-questions
https://realpython.com/quizzes/python-optional-arguments/
Using Python Optional Arguments When Defining Functionshttps://realpython.com/quizzes/python-optional-arguments/
https://realpython.com/feedback/survey/article/python-optional-arguments/liked/?from=article-footer
https://realpython.com/feedback/survey/article/python-optional-arguments/disliked/?from=article-footer
Defining Python Functions With Optional Argumentshttps://realpython.com/courses/defining-python-functions-with-optional-arguments/
https://realpython.com/team/sgruppetta/
» More about Stephenhttps://realpython.com/team/sgruppetta/
https://realpython.com/team/asantos/
Aldrenhttps://realpython.com/team/asantos/
https://realpython.com/team/bzaczynski/
Bartoszhttps://realpython.com/team/bzaczynski/
https://realpython.com/team/jjablonski/
Joannahttps://realpython.com/team/jjablonski/
https://realpython.com/team/jschmitt/
Jacobhttps://realpython.com/team/jschmitt/
https://realpython.com/team/lpozoramos/
Leodanishttps://realpython.com/team/lpozoramos/
https://realpython.com/team/mbreuss/
Martinhttps://realpython.com/team/mbreuss/
Level Up Your Python Skills »https://realpython.com/account/join/?utm_source=rp_article_footer&utm_content=python-optional-arguments
Level Up Your Python Skills »https://realpython.com/account/join/?utm_source=rp_article_footer&utm_content=python-optional-arguments
https://realpython.com/feedback/survey/article/python-optional-arguments/liked/?from=article-comments
https://realpython.com/feedback/survey/article/python-optional-arguments/disliked/?from=article-comments
LinkedInhttps://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Frealpython.com%2Fpython-optional-arguments%2F
Twitterhttps://twitter.com/intent/tweet/?text=Interesting%20Python%20article%20on%20%40realpython%3A%20Using%20Python%20Optional%20Arguments%20When%20Defining%20Functions&url=https%3A%2F%2Frealpython.com%2Fpython-optional-arguments%2F
Blueskyhttps://bsky.app/intent/compose?text=Interesting%20Python%20article%20on%20%40realpython.com%3A%20Using%20Python%20Optional%20Arguments%20When%20Defining%20Functions%20https%3A%2F%2Frealpython.com%2Fpython-optional-arguments%2F
Facebookhttps://facebook.com/sharer/sharer.php?u=https%3A%2F%2Frealpython.com%2Fpython-optional-arguments%2F
Get tips for asking good questionshttps://realpython.com/python-beginner-tips/#tip-9-ask-good-questions
get answers to common questions in our support portalhttps://support.realpython.com
Real Python Community Chathttps://realpython.com/community/
“Office Hours” Live Q&A Sessionhttps://realpython.com/office-hours/
basicshttps://realpython.com/tutorials/basics/
pythonhttps://realpython.com/tutorials/python/
Defining Python Functions With Optional Argumentshttps://realpython.com/courses/defining-python-functions-with-optional-arguments/
Logging in Pythonhttps://realpython.com/python-logging/?utm_source=realpython&utm_medium=web&utm_campaign=related-post&utm_content=python-optional-arguments
Python MarkItDown: Convert Documents Into LLM-Ready Markdownhttps://realpython.com/python-markitdown/?utm_source=realpython&utm_medium=web&utm_campaign=related-post&utm_content=python-optional-arguments
Python args and kwargs: Demystifiedhttps://realpython.com/python-kwargs-and-args/?utm_source=realpython&utm_medium=web&utm_campaign=related-post&utm_content=python-optional-arguments
A Close Look at a FastAPI Example Applicationhttps://realpython.com/fastapi-python-web-apis/?utm_source=realpython&utm_medium=web&utm_campaign=related-post&utm_content=python-optional-arguments
Defining Your Own Python Functionhttps://realpython.com/defining-your-own-python-function/?utm_source=realpython&utm_medium=web&utm_campaign=related-post&utm_content=python-optional-arguments
https://realpython.com/account/signup/?intent=continue_reading&utm_source=rp&utm_medium=web&utm_campaign=rwn&utm_content=v1&next=%2Fpython-optional-arguments%2F
Continue »https://realpython.com/account/signup/?intent=continue_reading&utm_source=rp&utm_medium=web&utm_campaign=rwn&utm_content=v1&next=%2Fpython-optional-arguments%2F
Sign-Inhttps://realpython.com/account/login/?next=/python-optional-arguments/
Start Herehttps://realpython.com/start-here/
Learning Resourceshttps://realpython.com/search
Code Mentorhttps://realpython.com/mentor/
Python Referencehttps://realpython.com/ref/
Python Cheat Sheethttps://realpython.com/cheatsheets/python/
Support Centerhttps://support.realpython.com/
Learning Pathshttps://realpython.com/learning-paths/
Quizzes & Exerciseshttps://realpython.com/quizzes/
Browse Topicshttps://realpython.com/tutorials/all/
Live Courseshttps://realpython.com/live/
Bookshttps://realpython.com/books/
Podcasthttps://realpython.com/podcasts/rpp/
Newsletterhttps://realpython.com/newsletter/
Community Chathttps://realpython.com/community/
Office Hourshttps://realpython.com/office-hours/
Learner Storieshttps://realpython.com/learner-stories/
Plans & Pricinghttps://realpython.com/account/join/
Team Planshttps://realpython.com/account/join-team/
For Businesshttps://realpython.com/account/join-team/inquiry/
For Schoolshttps://realpython.com/account/join-team/education-inquiry/
Reviewshttps://realpython.com/learner-stories/
About Ushttps://realpython.com/about/
Teamhttps://realpython.com/team/
Mission & Valueshttps://realpython.com/mission/
Editorial Guidelineshttps://realpython.com/editorial-guidelines/
Sponsorshipshttps://realpython.com/sponsorships/
Careershttps://realpython.workable.com
Press Kithttps://realpython.com/media-kit/
Merchhttps://realpython.com/merch
https://www.youtube.com/realpython
https://x.com/realpython
https://www.linkedin.com/company/realpython-com
https://www.facebook.com/LearnRealPython
https://github.com/realpython/
Privacy Policyhttps://realpython.com/privacy-policy/
Terms of Usehttps://realpython.com/terms/
Securityhttps://realpython.com/security/
Contacthttps://realpython.com/contact/
https://realpython.com/

Viewport: width=device-width, initial-scale=1, shrink-to-fit=no, viewport-fit=cover

Robots: max-image-preview:large


URLs of crawlers that visited me.