Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Introdução à Programação com Python - Parte 2
Search
Ana Paula Mendes
April 12, 2020
Programming
180
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Introdução à Programação com Python - Parte 2
Sumário:
Entrada e Saída;
Listas;
Tuplas;
Dicionários.
Ana Paula Mendes
April 12, 2020
More Decks by Ana Paula Mendes
See All by Ana Paula Mendes
Aprendendo sobre Complexidade de Algoritmos com o Timsort
anapaulamendes
0
300
Criando uma API async com rate limit e testável
anapaulamendes
0
79
Backend + IA: Criando uma API para inferir diagnóstico de diabetes
anapaulamendes
0
120
Já ouviu a palavra do FastAPI hoje?
anapaulamendes
1
290
Desbravando HTTP com http.server
anapaulamendes
2
210
Dados categóricos em árvore de decisão utilizando libs Python
anapaulamendes
1
720
Introdução à Programação com Python - Parte 3
anapaulamendes
1
120
Introdução à Programação com Python - Parte 4
anapaulamendes
1
100
Construindo experiências antes do mercado
anapaulamendes
0
170
Other Decks in Programming
See All in Programming
Simple Storage Service(S3) is not simple
iwatsukayura
0
120
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
530
AgentCore CLI で進化した AWS での AI エージェントの作り方 : 必要な機能を必要な時に
icoxfog417
PRO
4
410
iOSDC2026登壇資料.pdf
riofujimon
0
200
TiDB Cloudのカスタムコントローラーによるオートスケール対応
takaidohigasi
0
140
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
setup-vp GitLab対応の裏側
naokihaba
0
150
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
440
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
680
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
120
大喜利で理解するLLM as a Judge / Understanding LLM-as-a-Judge through Ogiri
rockname
0
190
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
520
Featured
See All Featured
The agentic SEO stack - context over prompts
schlessera
0
950
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
430
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.4k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
250
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.9k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
300
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
960
Discover your Explorer Soul
emna__ayadi
2
1.3k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
440
A Soul's Torment
seathinner
8
3.7k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
250
Transcript
ANA NO TERMINAL Ana Paula Mendes I n t r
o d u ç ã o à p r o g r a m a ç ã o c o m P y t h o n - p a r t e 2 @ananoterminal • @ananoterminal • @ananoterminal •
@ananoterminal • BACHARELANDA EM CIÊNCIA DA COMPUTAÇÃO - UFPI TÉCNICA
EM DESENVOLVIMENTO DE SOFTWARE - IFPI DESENVOLVEDORA FULL STACK AMO OPEN SOURCE Boas vindas again! ana no terminal ana Paula mendes
@ananoterminal • @ananoterminal • @ananoterminal • Entrada e Saída
entrada - input nome = input("Nome") idade = int(input("Idade: "))
altura = float(input("Altura: ")) @ananoterminal •
saída - print print("Hello World!") print("Seu nome é: ", nome)
print("Sua idade é: {}".format(idade)) print("Sua altura é: " + str(altura)) @ananoterminal •
@ananoterminal • @ananoterminal • @ananoterminal • Listas
Valores em uma lista Lista vazia vazia = [ ]
lista com itens frutas = ["banana", "melancia", "abacate"] @ananoterminal •
Métodos de lista adicionar itens frutas.append("uva") ordernar itens frutas.sort() @ananoterminal
• tamanho da lista len(frutas) acessar itens frutas[n]
Operações com lista concatenação de listas [1, 2, 3] +
[4, 5, 6] repetição de listas [1, 2, 3] * 3 @ananoterminal •
Operações com lista fatiamento de listas lista = [0, 1,
2, 3, 4, 5] lista[:4] lista[3:] lista[1:3] remoção de itens del lista[n] lista.pop(n) @ananoterminal •
@ananoterminal • @ananoterminal • @ananoterminal • Tuplas
Valores em uma tupla Tupla vazia vazia = () tupla
com 1 item tupla = 1, tupla = (1,) @ananoterminal • tupla com vários itens tupla = 1, 2, 3, 4, 5 tupla = (1, 2, 3, 4, 5)
Métodos de tupla ACESSA ITENS COMO NA LISTA; O FATIAMENTO
É COMO NA LISTA; É IMUTÁVEL, PORTANTO NÃO É POSSÍVEL REATRIBUIR VALORES NUMA TUPLA; É POSSÍVEL ADICIONAR ITENS APENAS CONCATENANDO TUPLAS. ZimCore Hubs • Apr. 30, 2020
Utilidade Pública Sem tupla a = 1 b = 2
temp = a a = b b = temp @ananoterminal • com tupla a = 1 b = 2 a, b = b, a
@ananoterminal • @ananoterminal • @ananoterminal • Dicionários
Valores em um dicionário dicionário vazio vazio = {} dicionário
com itens estudante = {"nome": "Ana", "idade": 22} @ananoterminal •
Métodos de dicionário adicionar itens estudante["matricula"] = "2020123" ordernar itens
sorted(estudante.items()) sorted(estudante.keys()) [('idade', 22), ('nome', 'Ana')] ['idade', 'nome'] @ananoterminal • tamanho do dicionário len(estudante)
Métodos de dicionário Acessar valores estudante["nome"] Acessar as chaves estudante.keys()
@ananoterminal • Remoção de itens del estudante["idade"] estudante.pop("idade") acessar os itens estudante.items()
@ananoterminal • ANA PAULA MENDES @ananoterminal TWITTER INSTAGRAM E-MAIL
[email protected]
obrigada :)