All Topics

Built-In Datatypes:-



In programming, data type is an important concept.
Variables can store data of different types, and different types can do different things.

Python has the following data types built-in by default, in these categories:
Text Type: str
Numeric Types: int, float, complex
Sequence Types: list, tuple, range
Mapping Type: dict
Set Types: set, frozenset
Boolean Type: bool
Binary Types: bytes, bytearray, memoryview

In Python, the data type is set when you assign a value to a variable
You can get the data type of any object by using the type() function
If you want to specify the data type, you can use the following constructor functions

There are three numeric types in Python:
int - Int, or integer, is a whole number, positive or negative, without decimals, of unlimited length.
float - Float, or "floating point number" is a number, positive or negative, containing one or more decimals.
complex - Complex numbers are written with a "j" as the imaginary part
Float can also be scientific numbers with an "e" to indicate the power of 10.

You can convert from one type to another with the int(), float(), and complex() methods
Python does not have a random() function to make a random number, but Python has a built-in module called random that can be used to make random numbers

Python has a set of built-in methods that you can use on strings.

Method
capitalise()
endswith()
count()
find()
index()
lstrip()
rstrip()
ljust()
rjust()
upper()
lower()
strip()
split()
strip()
join()
isalpha()



Hello