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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Ana Paula Mendes
April 12, 2020
Programming
3
170
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
210
Criando uma API async com rate limit e testável
anapaulamendes
0
68
Backend + IA: Criando uma API para inferir diagnóstico de diabetes
anapaulamendes
0
90
Já ouviu a palavra do FastAPI hoje?
anapaulamendes
1
270
Desbravando HTTP com http.server
anapaulamendes
2
190
Dados categóricos em árvore de decisão utilizando libs Python
anapaulamendes
1
690
Introdução à Programação com Python - Parte 3
anapaulamendes
1
110
Introdução à Programação com Python - Parte 4
anapaulamendes
1
91
Construindo experiências antes do mercado
anapaulamendes
0
160
Other Decks in Programming
See All in Programming
AI Assistants for Your Angular Solutions
manfredsteyer
PRO
0
130
CSC307 Lecture 15
javiergs
PRO
0
240
AIコードレビューの導入・運用と AI駆動開発における「AI4QA」の取り組みについて
hagevvashi
0
430
モックわからないマン卒業記 ~振る舞いを起点に見直した、フロントエンドテストにおけるモックの使いどころ~
tasukuwatanabe
2
110
nilとは何か 〜interfaceの構造とnil!=nilから理解する〜
kuro_kurorrr
3
1.9k
encoding/json/v2のUnmarshalはこう変わった:内部実装で見る設計改善
kurakura0916
0
400
How to stabilize UI tests using XCTest
akkeylab
0
120
S3ストレージクラスの「見える」「ある」「使える」は全部違う ─ 体験から見た、仕様の深淵を覗く
ya_ma23
0
400
Claude Code Skill入門
mayahoney
0
290
CSC307 Lecture 13
javiergs
PRO
0
320
社内規程RAGの精度を73.3% → 100%に改善した話
oharu121
13
8k
モジュラモノリスにおける境界をGoのinternalパッケージで守る
magavel
0
3.5k
Featured
See All Featured
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
280
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
130
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
100
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
140
Everyday Curiosity
cassininazir
0
160
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.5k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
150
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
230
Side Projects
sachag
455
43k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
760
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 :)