0
Python 3 variable Initialization
I am starting the Python3 course here. I just wanted to know in Python are you required to initialize your variables with a type as soon as you create them like in C++ and Java? For ex. I know on C++ I can't write x= 10; w/o specifying whether x is type int, float, or double. I would have to write int x= 10; do we have the same requirement in Python or can we just write x= 10 and go about our business w/o stating a type for x?
2 odpowiedzi
+ 5
i think you could get the answer faster trying it by yourself in the code section of sololearn :p
anyway, you can write x=10 without declaring the type -using python
+ 1
thank you