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
82 Capítulo 3
dena sua função
Reutilize o código com funções
A maioria das linguagens de programação permite criar um código
reutilizável e compartilhável com funções. Uma função é um bloco
de código que você separa do resto de seu programa, dá um nome
e, então, chama a partir de seu código.
Diferentes linguagens têm diferentes maneiras de criar funções. No
Python, use a palavra-chave def para denir uma nova função. Eis
um código Python que dene uma função make_smoothie():
def make_smoothie():
juice = input("What juice would you like? ")
fruit = input("OK - and how about the fruit? ")
print("Thanks. Let's go!")
print("Crushing the ice...") ...
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