IntroToPythonForTotalBeginners
|
⇤ ← Revision 1 as of 2010-02-24 22:24:49
Size: 61
Comment:
|
Size: 1072
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 7: | Line 7: |
| = Listing 1 = | = Part 1 - Get Ready to Code = You will need the following things: 1. A text editor (usually gedit) open. To get started, save an empty text file and name it "prize_hint.py" 1. A terminal window open and in the same directory as the the prize_hunt.py file. You are now ready to start writing a program. = Part 2 - Make the Computer Say things = Let's start by making the computer say something to the user. We do this using the "print" command. {{{ #!python print "You are outside the front door of the house. The prize is inside." }}} Type this line into your code file. The "print" command at the beginning tells the computer to print the string that comes next. A string is a list of characters enclosed by either an " or an '. Now you need to run your program. Do this by saving your file (very important to save it), and then go back to your terminal. Inside your terminal type: {{{ python prize_hunt.py }}} The result should be that the string you specified is printed out for the user to see. |
Intro
Resources
The Game
Part 1 - Get Ready to Code
You will need the following things:
- A text editor (usually gedit) open. To get started, save an empty text file and name it "prize_hint.py"
- A terminal window open and in the same directory as the the prize_hunt.py file.
You are now ready to start writing a program.
Part 2 - Make the Computer Say things
Let's start by making the computer say something to the user. We do this using the "print" command.
1 print "You are outside the front door of the house. The prize is inside."
Type this line into your code file. The "print" command at the beginning tells the computer to print the string that comes next. A string is a list of characters enclosed by either an " or an '.
Now you need to run your program. Do this by saving your file (very important to save it), and then go back to your terminal. Inside your terminal type:
python prize_hunt.py
The result should be that the string you specified is printed out for the user to see.
UbuntuOpportunisticDeveloperWeek/IntroToPythonForTotalBeginners (last edited 2010-02-25 04:19:29 by 97-126-115-182)