Basic Python - Variables and data types

avatar

NaN years ago

In programming, the variable holds values and every value has a data type. Python is a unique programming language, it dynamically allocates the data type according to the variable's value whereas most programming languages need a declaration of data type by a user.

In Python:

//Integer
variable = 12

//String
variable = "12"

//boolean
variable = true

In Others:

//Integer
int variable = 12

//String
str variable = "12"

//boolean
bool variable = false 

Python has also very unique built-in data types like Set, List, Tuple, Frozenset and Dictionary with lots of built-in features which makes python such an easy programming language to perform mathematical and string operations.

approvedApproved by experts
Advance Topics

Neuton's Mission

We are a team of young and enthusiastic people who are passionate about education and want to help students to learn the skills they need to succeed in life. If you want to support us, please join our community.

phonephonephonephonemail