02: Python: Input

Debug it:

Write a program that asks for input
Input: Write a program that asks for input

Debugging means finding and fixing errors (bugs) in your code.

Below is some code that has been deliberately broken so that you can find and fix some common mistakes when writing code that outputs text.

For those of you who are fortunate enough to have grown up without lots of “knock knock” jokes, this code should output the following:

> Knock Knock
Who's there?
> Wooden Shoe
Wooden Shoe who?
> Wooden Shoe like to know!

Hints: Check the brackets, spelling and quotation marks.

Your code won’t run at all until you’ve fixed all of the errors: You need to fix all the lines of code even before the first line will run.

Python is case sensitive: be careful with CAPITAL LETTERS and lowercase letters.

 

On the next page you’ll get some ideas for how to write your own projects that ask the user to input something.

One thought on “02: Python: Input

Leave a Reply

Your email address will not be published. Required fields are marked *