Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Introdução à Programação com Python - Parte 2
Search
Ana Paula Mendes
April 12, 2020
Programming
180
3
Share
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
280
Criando uma API async com rate limit e testável
anapaulamendes
0
75
Backend + IA: Criando uma API para inferir diagnóstico de diabetes
anapaulamendes
0
110
Já ouviu a palavra do FastAPI hoje?
anapaulamendes
1
280
Desbravando HTTP com http.server
anapaulamendes
2
200
Dados categóricos em árvore de decisão utilizando libs Python
anapaulamendes
1
710
Introdução à Programação com Python - Parte 3
anapaulamendes
1
120
Introdução à Programação com Python - Parte 4
anapaulamendes
1
99
Construindo experiências antes do mercado
anapaulamendes
0
170
Other Decks in Programming
See All in Programming
セキュリティの専門家じゃなくてもできる。「セキュリティ意識」をアップデートして サプライチェーン攻撃への耐性を高めよう。
tk3fftk
5
590
プロパティの順序で型推論が壊れる!? TypeScript6.0の修正からContext-Sensitivityの仕組みを追う
bicstone
2
1.3k
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.1k
AIとASP.NET Coreで雑Webアプリを作った話
mayuki
0
260
ふつうのFeature Flag実践入門
irof
7
3.5k
Inside Stream API
skrb
1
620
AI駆動開発勉強会 広島支部 第一回勉強会 AI駆動開発概要とワークショップ
hayatoshimiu
0
440
肥大化するレガシーコードに立ち向かうためのインターフェース分離と依存の逆転 / JJUG CCC 2026 Spring
hirokunimaeta
0
480
The NotImplementedError Problem in Ruby
koic
1
500
ローカルLLMを使ってB2Bサービスを作っていての学び
yaotti
0
110
さぁV100、メモリをお食べ・・・
nilpe
0
130
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
6
810
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
304
22k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.9k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
530
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
240
Typedesign – Prime Four
hannesfritz
42
3.1k
Scaling GitHub
holman
464
140k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.5k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
430
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.7k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
280
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
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 :)