Def: meaning, definitions and examples

📜
Add to dictionary

def

 

[ def ]

Verb
Context #1 | Verb

programming term

In programming, 'def' is a keyword used to define a function. It indicates the beginning of a function definition and is followed by the function name and parentheses containing any parameters. The body of the function is then indicated by an indent. This keyword is prevalent in languages like Python. Functions defined with 'def' can take inputs and return outputs, making it a fundamental building block in coding.

Synonyms

declare, define, establish.

Examples of usage

  • def calculate_sum(a, b):
  • def greet_user(name):
  • def find_maximum(numbers):

Translations

Translations of the word "def" in other languages:

🇵🇹 definir

🇮🇳 परिभाषित करना

🇩🇪 definieren

🇮🇩 menentukan

🇺🇦 визначати

🇵🇱 definiować

🇯🇵 定義する

🇫🇷 définir

🇪🇸 definir

🇹🇷 tanımlamak

🇰🇷 정의하다

🇸🇦 تعريف

🇨🇿 definovat

🇸🇰 definovať

🇨🇳 定义

🇸🇮 definirati

🇮🇸 skilgreina

🇰🇿 анықтау

🇬🇪 გახორციელება

🇦🇿 təyin etmək

🇲🇽 definir

Etymology

The term 'def' as a keyword in programming languages comes from the English word 'define', which has its roots in Latin 'definire', meaning 'to determine, limit, or set boundaries'. The abbreviation 'def' was favored in early programming languages for its brevity, making it easier for developers to write and read code. As programming languages evolved, particularly with the rise of Python in the late 1990s, 'def' became associated with the simple and clear syntax that Python promoted. Today, 'def' symbolizes not just the action of defining a function but also embodies the principles of clean coding that many programming languages strive for. Its usage continues to grow as new programmers enter the field and adopt these foundational coding practices.