It's time to dive in and make something happen. How about getting words to print out on the screen? Seems simple enough. Python does that with the
print "Hello, World!"
Yeah, the boring programming trope: Hello, World! When you run this code, it looks like this:
We could output any string of characters. Here's another piece of code:
print "He walked saucily across the room, flouncing unflatteringly as he went."
print "The look in his eye told much of his affectations."
print "Indeed, much of his life was unabated self-delusion."
Here we used multiple
You don't always need to use multiple print statements for multiple lines. "Special" characters can be printed, including a newline or a tab. Newline and tab are the two that I use most frequently, so here's an example using both:
print "She saw him coming.\nShe was not impressed.\n\n\tNot at all."
The above code looks like this when run:
So, now the computer, through python, repeats whatever we tell it to repeat. As fun as this can be, we want a bit more flexibility. With that in mind, our next lesson: variables