Hi there, we’re Harisystems

"Unlock your potential and soar to new heights with our exclusive online courses! Ignite your passion, acquire valuable skills, and embrace limitless possibilities. Don't miss out on our limited-time sale - invest in yourself today and embark on a journey of personal and professional growth. Enroll now and shape your future with knowledge that lasts a lifetime!".

For corporate trainings, projects, and real world experience reach us. We believe that education should be accessible to all, regardless of geographical location or background.

1
1

Python Data Types

Data types are an essential concept in programming as they define the nature of the data that can be stored and manipulated. Python, being a dynamically typed language, provides several built-in data types to handle different kinds of data. Let's explore some of the commonly used Python data types.

Numeric Data Types

Python supports various numeric data types, including:

  • int: Represents whole numbers, positive or negative, without any decimal points. For example: 5, -10, 0
  • float: Represents real numbers with decimal points. For example: 3.14, -2.5, 0.0
  • complex: Represents complex numbers in the form "a + bj", where "a" and "b" are real numbers, and "j" represents the imaginary unit. For example: 2 + 3j, -1.5 + 0j

Example:

    age = 25
price = 9.99
z = 2 + 3j
  

In the above example, we declared three variables of different numeric data types: "age" as an int, "price" as a float, and "z" as a complex number.

String Data Type

The string data type in Python is used to represent textual data. It is enclosed in single quotes ('') or double quotes (""). For example: "Hello", 'Python', "123".

Example:

    name = "John"
message = 'Welcome to Python!'
  

In the above example, we declared two variables "name" and "message" as strings.

Boolean Data Type

The boolean data type represents truth values, either True or False. It is commonly used for conditional statements and logical operations.

Example:

    is_student = True
has_license = False
  

In the above example, we declared two variables "is_student" and "has_license" as booleans.

List Data Type

A list is an ordered collection of items enclosed in square brackets ([]). It can contain elements of different data types, and the elements can be modified.

Example:

    fruits = ['apple', 'banana', 'orange']
numbers = [1, 2, 3, 4, 5]
  

In the above example, we declared two variables "fruits" and "numbers" as lists.

Conclusion

Python provides a wide range of built-in data types to handle different kinds of data. By understanding and utilizing these data types, you can effectively manage and manipulate data in your Python programs.

4.5L

Learners

20+

Instructors

50+

Courses

6.0L

Course enrollments

4.5/5.0 5(Based on 4265 ratings)

Future Trending Courses

When selecting, a course, Here are a few areas that are expected to be in demand in the future:.

Beginner

The Python Course: Absolute Beginners for strong Fundamentals

By: Sekhar Metla
4.5 (13,245)
Intermediate

JavaScript Masterclass for Beginner to Expert: Bootcamp

By: Sekhar Metla
4.5 (9,300)
Intermediate

Python Coding Intermediate: OOPs, Classes, and Methods

By: Sekhar Metla
(11,145)
Intermediate

Microsoft: SQL Server Bootcamp 2023: Go from Zero to Hero

By: Sekhar Metla
4.5 (7,700)
Excel course

Future Learning for all

If you’re passionate and ready to dive in, we’d love to join 1:1 classes for you. We’re committed to support our learners and professionals their development and well-being.

View Courses

Most Popular Course topics

These are the most popular course topics among Software Courses for learners