LPTHW – Exercise 1: A Good First Program

Pretty simple introduction this, just a few print statements. Example code will be the answers to the student questions…

# 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 "This is another line."


Learn Python The Hard Way Study Drills

1. Make your script print another line.

Done. See code (multiple print statements print multiple lines).

2. Make your script print only one of the lines.

Comment out all but one – done.

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

A ‘#’ comments out a line meaning it won’t be actioned by the interpreter.