Is there any need of declaring a variable in python?? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 4

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

Python

30th Jun 2020, 2:35 PM
PUJA CHOURSIYA
PUJA CHOURSIYA - avatar
4 ответов
+ 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