+ 6
variables in python
why variables don't have data type?
40 Respostas
+ 31
they are automatically assigned, it's just how python is made, simple elegant and only requires minimum amount of code, rest Python does for you :)
+ 20
This is not just in Python. The same is done in VBA for variables by default, in JavaScript, and earlier it was in DBase and its descendants: FoxBase, FoxPro, Clipper.
+ 14
they do kinda you just don't have to pre define the data type for the variable
+ 6
The variables data type are determined by their value assigned. This way a variable is flexible in its use, such as where an integer may be useful here then a float may be useful there.
+ 2
It can't show the variable i've made
+ 1
Once an object is assigned to a variable, you can refer to the object by that name.
Ex:x=4 here,x is the variable name that assigned to 4.we can refer variable to get the value assigned to it.
+ 1
My fist comment
+ 1
Every variable in Python is considered as an object. Variables in Python follow the standard nomenclature of an alphanumeric name beginning in a letter or underscore. Based on the data type of a variable, the interpreter allocates memory and decides what can be stored in the reserved memory. You do not need to declare variables before using them, or declare their type. Variable names are case sensitive . Most variables in Python are local in scope to their own function or class. Global variables , however, can be declared with the global keyword.
0
Python is best I't dont like any language
0
Becasuse we asaign a value to a variable and we decide what type of value we give to it
0
Nasıl yok var
0
Only when you declare the values, the variables can be classified
0
Python is a dynamic language
0
Depends on the values assigned to the variables
0
Bcuz they change their data types according to the output value
0
Python are lots of built in libraries and packages
0
They have a data type dependent on what you initialize them to be
0
Python is a programming language. 💯
0
Because Python automatically understands the data type when you assign a value to it and there's no need to determine whether the data type is integer or float or string.
For example:
A = 7 #No need to write int A
B = 7.5 #No need to write float B
C = "Hi" #No need to write string C
0
Variables generally have a data type when they are a assigned to a certain value. The data type of variable can be found by the type of value assigning to it.
eg:-We calls different variables as numeric variables as they are assigned to numeric value.(n=5.1 , n is a numeric variable as the float value is assigned to it).