Django Girls
Free programming workshop for women
Emmanuel Anebi
March, 2022
Python,
Data Types and
The Virtual Environment
What is Python? 🐍
Python is a computer programming language
often used to build websites and software,
automate tasks, and conduct data analysis.
Python is a general-purpose language, meaning
it can be used to create a variety of different
programs and isn't specialized for any specific
problems.
Things you can do with Python?
● Doing general software development.
● Diving into data science and math.
● Speeding up and automating your
workflow.
● Building embedded systems and robots.
AGENDA
Data Types
In Python, numeric data type represents the data that has a
numeric value. The numeric value can be an integer, floating
number, or even complex number. These values are defined
as int, float, and complex classes in Python. Integers – This
data type is represented with the help of int class.
Variables can store data of different types, and different types can
do different things.
Data Types
Example
a = 2
a -> variable
2 -> data
In Python, the data type is set when you assign a value to
a variable! This is referred to as Dynamic Typing
Data Types
Dynamic typing in Python means
the interpreter itself infers the type
of data that a variable receives,
without the need of the user.
Data Types
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
Data Types
Practical Examples:
x = "Hello World"
x = 20
x = 20.5
x = ["apple", "banana", "cherry"]
x = True
Let’s welcome the type () function.
But...
Data Types
If you want to specify the data type, you can use the
following constructor functions:
x = str("Hello World")
x = int(20)
x = float(20.5)
x = list(("apple", "banana", "cherry"))
References
1. https://tutorial.djangogirls.org/en/
2. https://medium.com/@themlphdstudent/python-basics-variables-dat
a-types-and-list-59cea3dfe10f
3. https://www.w3schools.com/python/python_datatypes.asp
THANK YOU