Step 1 – titles and think of the number
These are so easy that I've combined them.
- start by adding the titles just like in your binary search algorithm using print() statements
- then add import random at the top – Python can't deal with random numbers without this
- then create the random number using random.randint(1, 20). Store the value in a variable called theNumber
- save your program as something like "simple linear search" and run it to check there aren't any errors
Don't forget to run the program.
If you want to see what number the program has generated, add a line that has print (theNumber) at the end