Hardware Reference
In-Depth Information
Adventure 5
Programming
with Python
PROGRAMMING WITH SCRATCH can be a lot of fun, but as you become more skillful
at creating games and graphics using this application, you may notice that there are
limits to what you can achieve with Scratch. Most computer programmers use text-
based languages to create computer programs, including games, desktop applications
and mobile apps. Although text-based programming may seem more complicated at
irst, you will soon ind that it is easier to achieve your goals by using code. he Python
code language is used by millions of programmers worldwide, including developers at
organisations like NASA, Google and CERN.
In this adventure, you'll discover what you need in order to set up Python on your
Raspberry Pi. You'll write a short program, and learn to use a text editor. After that,
you'll delve deeper into Python, learning about modules and their applications, how to
get user input and how to use conditionals. Finally, you'll put all your new knowledge
to use, creating a text-based adventure game in which your user (player) will answer
questions and your game will respond based on the answers.
Although this may seem like a major departure from the graphical world of Scratch pro-
gramming, the good news is that all of the programming concepts you learned in
Scratch apply to other languages as well, even those that seem very diferent. Concepts
such as using a sequence of instructions to make something happen, loops, conditionals
and variables are common throughout all programming languages. By the end of this
adventure, you'll be able to write some basic Python programs on your Raspberry Pi!
Search WWH ::




Custom Search