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
+ 1
Python...
name="Justin"
age=15
Java...
String name = "Justin";
int age = 15;
you do not have to initialize in Python
0
thank you