Def: meaning, definitions and examples
📜
def
[ def ]
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
- definir como
- definição
🇮🇳 परिभाषित करना
- परिभाषा
- निश्चित करना
🇩🇪 definieren
- Definition
- festlegen
🇮🇩 menentukan
- definisi
- mendefinisikan
🇺🇦 визначати
- визначення
- дефініція
🇵🇱 definiować
- definicja
- określać
🇯🇵 定義する
- 定義
- 明確にする
🇫🇷 définir
- définition
- établir
🇪🇸 definir
- definición
- establecer
🇹🇷 tanımlamak
- tanım
- belirlemek
🇰🇷 정의하다
- 정의
- 설정하다
🇸🇦 تعريف
- يحدد
- تحديد
🇨🇿 definovat
- definice
- stanovit
🇸🇰 definovať
- definícia
- určiť
🇨🇳 定义
- 确定
- 规定
🇸🇮 definirati
- definicija
- določiti
🇮🇸 skilgreina
- skilgreining
- ákveða
🇰🇿 анықтау
- анықтама
- белгілеу
🇬🇪 გახორციელება
- განსაზღვრა
- განსაზღვრება
🇦🇿 təyin etmək
- tərif
- müəyyənləşdirmək
🇲🇽 definir
- definición
- establecer
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.