+ 4

Is there any need of declaring a variable in python??

Python

30th Jun 2020, 2:35 PM
PUJA CHOURSIYA
PUJA CHOURSIYA - avatar
4 odpowiedzi
+ 4
You don't need to declare anything before you really use it. x = None # ... x = 1 The first line in this example is not need if you don't do anything with x unless line 3.
30th Jun 2020, 2:43 PM
Lisa
Lisa - avatar
+ 2
No, there is not. Actually the advantage of Python is you can assign a value to a variable (i.e. a string) and later re-assign another value even of a different type (i.e. integer).
30th Jun 2020, 2:40 PM
Matthias Seidl
+ 2
Thanks
30th Jun 2020, 2:41 PM
PUJA CHOURSIYA
PUJA CHOURSIYA - avatar
+ 2
Thanks lisa🤗🤗
30th Jun 2020, 2:44 PM
PUJA CHOURSIYA
PUJA CHOURSIYA - avatar