Why we are not declaring variables anywhere in Python? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

Why we are not declaring variables anywhere in Python?

No data type is defined?

5th Jun 2018, 12:09 PM
Faisal Khan
Faisal Khan - avatar
3 ответов
+ 1
In other languages(c/c++/java)we have to specify it's type explicitly which means that we are specifying to compiler this belongs this type ,that belongs that type lyk that,but where as in Python by default, input() accepts data in String format we have to convert to our designed format by just specifying its type before input(), lyk int(input())to convert string to int & lyk wise float(input()) for float type, interpretar assigns that type to particular identifier
5th Jun 2018, 1:40 PM
Amal Reddy Marella
Amal Reddy Marella - avatar
+ 5
Python assigns a datatype each time you reassign its value to either string or integer etc
5th Jun 2018, 12:23 PM
Scorpia Rising🎩
Scorpia Rising🎩 - avatar
0
thank you
5th Jun 2018, 6:10 PM
Faisal Khan
Faisal Khan - avatar