Function with No Parameters in Python – Programming, Pseudocode Example, C# Programming Example
Python 3

Function with No Parameters in Python

In Python, we can define functions to make our code reusable, more readable, and organized. This is the basic syntax of a Python function:

Tip: a function can have zero, one, or multiple parameters.

A function with no parameters has an empty pair of parentheses after its name in the function definition. For example:

This is the output when we call the function:

You have to write an empty pair of parentheses after the name of the function to call it.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.