Introdução: Python
Prof. Dr. Max E. Vizcarra Melgar
• Python é uma linguagem de
programação de alto nível,
interpretada, de script, imperativa,
orientada a objetos, funcional, de
tipagem dinâmica e forte.
• Foi lançada por Guido van Rossum
em 1991;
• Possui tipagem dinâmica e uma de
suas principais características é
permitir a fácil leitura do código e
exigir poucas linhas de código se
comparado ao mesmo programa em
outras linguagens.
• https://www.python.org/
• https://python.org.br/
2
• Aprendizagem rápida;
• Menor quantidade de
código;
• Sintaxe fácil de ler;
• Usado em todas as empresas
de tecnologia de ponta;
• Enorme quantidade de
livrarias open-source
3
• Python 2 sem patch de segurança ara 2020;
• Ainda existem muitas empresas que trabalham com
Python 2;
• Versões MUITO similares!
• Pacotes liberados para Python 2 e 3 ou somente para
Python 3.
• USAREMOS Python 3!!
4
Instalação em Windows
5
Instalação em Windows
6
Online (versão que usaremos)
1. Assista o vídeo: MELHOR FORMA DE APRENDER PYTHON (Google
Colab Notebook) https://www.youtube.com/watch?v=Gojqw9BQ5qY
3. Crie sua conta GOOGLE (Gmail) e GitHub!
4. Execute Github and Google Colab → https://www.youtube.com/watch?v=IAqSGivFmEM
5. Acesse: https://colab.research.google.com/notebooks/intro.ipynb
7
Online (versão que usaremos)
8
Variáveis
9
Operadores aritméticos
10
Variáveis Dinâmicas
Vantagens:
• Fácil de trabalhar;
• Desenvolvimento mais rápido.
Desvantagens:
• Bugs por tipos de entradas inesperadas;
• Ficar ligado em type()
11
Strings
Strings são IMUTÁVEIS! Use Listas para conseguir mudar!
12
Strings
13
Strings
14
Listas
15
Listas
16
Dicionários
Dicionários: objetos chamados pelo nome chave e não são ordenados.
Listas: objetos chamados pela posição
17
Tuples
Similares com as listas, porém são IMUTÁVEIS! → Não podem ser reescritos!
Integridade de dados!
18
Sets
Coleções não ordenadas de elementos únicos!
19
Boolean
True or False!
20
Files
21
Fim do Capítulo!
Basic Practice:
http://codingbat.com/python
More Mathematical (and Harder) Practice:
https://projecteuler.net/archives
List of Practice Problems:
http://www.codeabbey.com/index/task_list
A SubReddit Devoted to Daily Practice Problems:
https://www.reddit.com/r/dailyprogrammer
A very tricky website with very few hints and touch problems (Not for
beginners but still interesting)
http://www.pythonchallenge.com/
22