{article Learn Python The Hard Way}{text}{/article}

Type in Notepad++

and save as File: ex1.py.

print "Hello World!"
print "Hello Again"
print "I like typing this."
print "This is fun."
print 'Yay! Printing.'
print "I'd much rather you 'not'."
print 'I "said" do not touch this.'

Run in Window PowerShell

PS C:\> cd mystuff

PS C:\mystuff> python ex1.py
Hello World!
Hello Again
I like typing this.
This is fun.
Yay! Printing.
I'd much rather you 'not'.
I "said" do not touch this.

Study Drill 1:

Make your script print another line.

#Script print another line

print "Hello World!"
print "Hello Again"
print "I like typing this."
print "This is fun."
print 'Yay! Printing.'
print "I'd much rather you 'not'."
print 'I "said" do not touch this.'
print "Print another line."

PS C:\\mystuff> python ex1sd1.py
Hello World!
Hello Again
I like typing this.
This is fun.
Yay! Printing.
I'd much rather you 'not'.
I "said" do not touch this.
Print another line.

Study Drill 2:

Make your script print only one of the lines.

# Use octothorpe (comment) on all line but one to print only one line


# print "Hello World!"
# print "Hello Again"
# print "I like typing this."
# print "This is fun."
# print 'Yay! Printing.'
# print "I'd much rather you 'not'."
# print 'I "said" do not touch this.'
# print "Print another line."
print " Print only one line."

PS C:\mystuff> python ex1sd2.py
Only one line.

Study Drill 3

Put a '#' (octothorpe) character at the beginning of a line. What did it do? Try to find out what this character does?

It case the line no to print.