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
3
160
Introdução à Programação com Python - Parte 2
Sumário:
Entrada e Saída;
Listas;
Tuplas;
Dicionários.
Ana Paula Mendes
April 12, 2020
Tweet
Share
More Decks by Ana Paula Mendes
See All by Ana Paula Mendes
Aprendendo sobre Complexidade de Algoritmos com o Timsort
anapaulamendes
0
140
Criando uma API async com rate limit e testável
anapaulamendes
0
49
Backend + IA: Criando uma API para inferir diagnóstico de diabetes
anapaulamendes
0
69
Já ouviu a palavra do FastAPI hoje?
anapaulamendes
1
260
Desbravando HTTP com http.server
anapaulamendes
2
170
Dados categóricos em árvore de decisão utilizando libs Python
anapaulamendes
1
660
Introdução à Programação com Python - Parte 3
anapaulamendes
1
96
Introdução à Programação com Python - Parte 4
anapaulamendes
1
73
Construindo experiências antes do mercado
anapaulamendes
0
150
Other Decks in Programming
See All in Programming
〜可視化からアクセス制御まで〜 BigQuery×Looker Studioで コスト管理とデータソース認証制御する方法
cuebic9bic
1
270
OpenNext + Hono on Cloudflare でイマドキWeb開発スタックを実現する
rokuosan
0
110
衛星の軌道をWeb地図上に表示する
sankichi92
0
250
ユーザーにサブドメインの ECサイトを提供したい (あるいは) 2026年函館で一番熱くなるかもしれない言語の話
uvb_76
0
180
從零到一:搭建你的第一個 Observability 平台
blueswen
0
220
eBPFを用いたAIネットワーク監視システム論文の実装 / eBPF Japan Meetup #4
yuukit
3
620
Blueskyのプラグインを作ってみた
hakkadaikon
1
290
ワンバイナリWebサービスのススメ
mackee
10
7.5k
漸進。
ssssota
0
1.2k
技術的負債と戦略的に戦わざるを得ない場合のオブザーバビリティ活用術 / Leveraging Observability When Strategically Dealing with Technical Debt
yoshiyoshifujii
0
160
AI Coding Agent Enablement in TypeScript
yukukotani
17
7.2k
Feature Flag 自動お掃除のための TypeScript プログラム変換
azrsh
PRO
4
630
Featured
See All Featured
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.2k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.3k
What's in a price? How to price your products and services
michaelherold
245
12k
Making the Leap to Tech Lead
cromwellryan
134
9.3k
Art, The Web, and Tiny UX
lynnandtonic
298
21k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
137
34k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
25
2.8k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
45
9.6k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.3k
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 :)