The following example code shows A Program to Demonstrate Various Data Types in Python.

Basically, the python language has several data types. Like other programming languages, python also has numeric and non-numeric data types. The following program shows the use of integer, float, string, boolean, complex, and the list data types.

# programmingempire.com
# This program demonstrates data types in python
pname = "Reema"
p_age = 12
year_of_birth = 2010
is_new_user = True
favorite_food = ['Taco', 'Dragon Fruit']



rating = 2.7
print(rating, type(rating))

p_name = "Reema"
print(p_name, type(p_name))

p_marks = 74
print(p_marks, type(p_marks))

is_passed = True
print(is_passed, type(is_passed))

my_complex_number = 4 + 5j
print(my_complex_number, type(my_complex_number))

fruits_list = ['Mango', 'Orange', 'Grapes']
print(fruits_list, type(fruits_list))

Output

The Output of A Program to Demonstrate Various Data Types in Python
The Output of A Program to Demonstrate Various Data Types in Python

Further Reading

Python Practice Exercise

Examples of OpenCV Library in Python

Examples of Tuples in Python

Python List Practice Exercise

A Brief Introduction of Pandas Library in Python

A Brief Tutorial on NumPy in Python

programmingempire

princites.com

IITM Software Development Cell