Understanding Python Data Types
Python has various built-in data types. Let's explore some of them:
1. Numeric Types
Python supports integers, floating-point numbers, and complex numbers.
# Example
integer_var = 10
float_var = 3.14
complex_var = 2 + 3j
2. Strings
Strings are sequences of characters. They can be created with single or double quotes.
# Example
str_var = 'Hello, Python!'
3. Lists
Lists are ordered, mutable sequences.
# Example
my_list = [1, 2, 'three', 4.0]
Understanding Python Data Types
Reviewed by Naveen Gupta
on
1:02 AM
Rating:
No comments: