Skip to Main Content
USE A CABEÇA! PROGRAMAÇÃO
book

USE A CABEÇA! PROGRAMAÇÃO

by David Griffiths, Paul Barry
January 2009
Beginner to intermediate content levelBeginner to intermediate
440 pages
13h 6m
Portuguese (Portugal, Brazil)
Alta Books
Content preview from USE A CABEÇA! PROGRAMAÇÃO
62 Capítulo 2
O código do programa para adicionar o recurso estava na porta da
geladeira. Você teve que organizar os ímãs para que o programa
executasse um laço até o preço ser $4.74 ou menos.
import urllib.request
while price > 4.74:
text = page.read().decode("utf8")
where = text.nd(‘>$’)
end_of_price = start_of_price + 4
start_of_price = where + 2
price = text[start_of_price:end_of_price]
print ("Buy!")
price = 99.99
Você
lembrou
de
indentar
estas
linhas?
Elas
estão
dentro
do laço
Esta linha não deve
ser indentada, pois
está fora do laço.
page = urllib.request.urlopen("http://www.beans-r-us.biz/prices.html")
UC Programming - Finalizado.indb 62 01/03/2016 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

USE A CABEÇA! ÁLGEBRA

USE A CABEÇA! ÁLGEBRA

Tracey Pilon, Dan Pilon
Use A Cabeça Ágil

Use A Cabeça Ágil

Jennifer Stellman, Andrew Greene
Use A Cabeça Padrões E Projetos

Use A Cabeça Padrões E Projetos

Eric Freeman, Elisabeth Freeman, Kathy Sierra, Bert Bates

Publisher Resources

ISBN: 9788576084730