Is Python distinguished between declaration and definition?

Asked 2 years ago, Updated 2 years ago, 34 views

I am using vscode and

go to definition

go to declaration

does not seem to change, but

Does Python, the interpreter language, make little difference or distinction?

python

2022-09-30 19:38

1 Answers

In other languages, the definition of "declaration" is used to indicate the existence of variables along with the data types of variables. Python only initializes variables with their respective values.

Python

#initialization
number = 10
data=["hello", 1, "naokiri", 16, (1, 2)]

Java

// Declaration
int number;
number = 10; //
// Declaration and Use
string letter="naokiri";


2022-09-30 19:38

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.