Docsity

Aula Python 2026 introdução, Resumos de Bancos de Dados Relacionais

Pré-visualização parcial do texto

Baixe Aula Python 2026 introdução e outras Resumos em PDF para Bancos de Dados Relacionais, somente na Docsity!

Lighthouse

Introdução ao Python

Antônio (John) Hickel

Data Engineer

antonio.hickel @indicium.ai

O que é Python

Python is an interpreted, object-oriented, high-level programming

language with dynamic semantics. Its high-level built in data structures,

combined with dynamic typing and dynamic binding, make it very

attractive for Rapid Application Development, as well as for use as a

scripting or glue language to connect existing components together.

Python's simple, easy to learn syntax emphasizes readability and

therefore reduces the cost of program maintenance. Python supports

modules and packages, which encourages program modularity and

code reuse. The Python interpreter and the extensive standard library are

available in source or binary form without charge for all major platforms,

and can be freely distributed.

https://www.python.org/doc/essays/blurb/

Definição dos desenvolvedores

O que é Python

Python is an interpreted, object-oriented, high-level programming

language with dynamic semantics. Its high-level built in data structures,

combined with dynamic typing and dynamic binding, make it very

attractive for Rapid Application Development, as well as for use as a

scripting or glue language to connect existing components together.

Python's simple, easy to learn syntax emphasizes readability and

therefore reduces the cost of program maintenance. Python supports

modules and packages, which encourages program modularity and

code reuse. The Python interpreter and the extensive standard library are

available in source or binary form without charge for all major platforms,

and can be freely distributed.

https://www.python.org/doc/essays/blurb/

Definição dos desenvolvedores

Rodando Python na máquina

O que vimos nas aulas de introdução à programação:

● Como executar código + print(“Hello World!”)

● Variables

● Python dataclasses

● Condicionais

● Loops

Recapitulando

Recapitulando

Python Data Types

str bytes, bytearray,

memoryview

Text type

Numeric Types

Binary types

None Type

int, float, complex

NoneType

Sequence Types

list, tuple, range

dict

Mapping Type

Set Type

set, frozenset

Boolean Type

bool

str bytes, bytearray,

memoryview

Text type

Numeric Types

Binary types

None Type

int, float, complex

NoneType

Sequence Types

list, tuple, range

dict

Mapping Type

Set Type

set, frozenset

Boolean Type

bool

Recapitulando

Python Data Types

Recapitulando

Operações com números

Operações com números são determinadas pelos operadores

Retorna int ou float

Retorna int ou float

Retorna int ou float

Retorna float (sempre)

Retorna int ou float

Retorna int ou float

Retorna int ou float

Fonte: https://www.w3schools.com/python/python_numbers.asp

Recapitulando

Operações com tipos de sequência

Tuples - ()

❖ Ordenadas, imutáveis e permitem duplicatas ❖ Itens são indexados ❖ Acesso: tuple[i]

Métodos:

❖ tuple.count(value)

❖ tuple.index(i)

❖ len(tuple)

Lists - []

❖ Ordenadas, mutáveis e permitem duplicatas ❖ Itens são indexados ❖ Acesso: list[i] ou list[range]

Métodos: ❖ list.append(value) ❖ list.count(value) ❖ list.index(i) ❖ list.insert(i, elmnt) ❖ list[i] = new_value ❖ list.pop(i) ❖ list.remove(elmnt) ❖ list.sort() ❖ lent(list)

Dicts - {k: v}

❖ Guardam dados em {chave: valor} ❖ Ordenados, mutáveis e não permitem duplicatas ❖ Acesso: dict[key] ou dict.get(key)

Métodos:

❖ dict.pop(keyname)

Recapitulando

Condicionais

if (condição1): declaração elif (condição2): outra_declaração else: declaração_sem_condição

Recapitulando (^) Operators

Assignment operators

Dever de casa: operator precedence https://www.w3schools.com/python/python_operators.asp

Fonte: https://www.w3schools.com/python/python_operators.asp

Logical operators

Fonte: https://www.w3schools.com/python/python_operators.asp

Identity operators Membership operators

Recapitulando (^) Operators

Para listas, strings:

❖ | for i in iterable:

| statement

Para ranges:

❖ | for i in range(start, stop, step):

| statement

Para dicts:

❖ | for key, value in my_dict.items():

| statement with key and value

❖ | for key in dict:

| statement involving my_dict[key]

Recapitulando

Loops

while loop

i = int while i < int: statement if i == condition: continue (skip) if i == other_condition: break step (incrementar i ou o que quiser)

Enumerate:

❖ | for i, key, value in enumerate(my_dict.items()): | statement with key and value