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
200
Criando uma API async com rate limit e testável
anapaulamendes
0
59
Backend + IA: Criando uma API para inferir diagnóstico de diabetes
anapaulamendes
0
82
Já ouviu a palavra do FastAPI hoje?
anapaulamendes
1
270
Desbravando HTTP com http.server
anapaulamendes
2
180
Dados categóricos em árvore de decisão utilizando libs Python
anapaulamendes
1
680
Introdução à Programação com Python - Parte 3
anapaulamendes
1
100
Introdução à Programação com Python - Parte 4
anapaulamendes
1
85
Construindo experiências antes do mercado
anapaulamendes
0
150
Other Decks in Programming
See All in Programming
PC-6001でPSG曲を鳴らすまでを全部NetBSD上の Makefile に押し込んでみた / osc2025hiroshima
tsutsui
0
200
Tinkerbellから学ぶ、Podで DHCPをリッスンする手法
tomokon
0
150
2年のAppleウォレットパス開発の振り返り
muno92
PRO
0
130
大規模Cloud Native環境におけるFalcoの運用
owlinux1000
0
230
tparseでgo testの出力を見やすくする
utgwkk
2
330
Jetpack XR SDKから紐解くAndroid XR開発と技術選定のヒント / about-androidxr-and-jetpack-xr-sdk
drumath2237
1
230
クラウドに依存しないS3を使った開発術
simesaba80
0
200
Findy AI+の開発、運用におけるMCP活用事例
starfish719
0
2k
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
210
AI 駆動開発ライフサイクル(AI-DLC):ソフトウェアエンジニアリングの再構築 / AI-DLC Introduction
kanamasa
11
4.7k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
550
re:Invent 2025 のイケてるサービスを紹介する
maroon1st
0
160
Featured
See All Featured
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Building the Perfect Custom Keyboard
takai
2
670
Being A Developer After 40
akosma
91
590k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.1k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
860
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
The Limits of Empathy - UXLibs8
cassininazir
1
200
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Become a Pro
speakerdeck
PRO
31
5.8k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
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 :)