Skip to content

Latest commit

 

History

History
11 lines (6 loc) · 1.05 KB

File metadata and controls

11 lines (6 loc) · 1.05 KB

Names in Python

In Python, a name is an identifier that is used to refer to a value or object. Names can be used to create variables, functions, and objects, which are all types of named entities that can store or perform actions on data.

A variable is a named container in Python, that holds the reference to the value hold by a memory location. This value can be of any data type, such as numbers, strings, or lists. Variables are created by assigning a value to a name using the = operator.

A function is a named block of code that can perform a specific task when called. Functions are defined using the def keyword, and can take zero or more arguments as input, and can optionally return a value.

An object is a named instance of a class, which is a blueprint for creating objects with specific properties and methods. Objects are created using the class keyword, and can have attributes and methods that can be accessed and manipulated using dot notation.

In all cases, it is through these names that we can access the associated values or perform actions on them.