Computational thinking is the thought processes involved in formulating a problem and expressing its solution(s) in such a way that a computer—human or machine—can effectively carry out.
1. The following is an algorithm someone wrote for brushing your teeth:
- Wet the toothbrush
- Put toothpaste on the toothbrush
- Brush each side of your teeth for 30 seconds
- Spit
- Rinse
Is this algorithm executable? If not, revise it.
2. Write an algorithm for making a peanut butter and jelly sandwich:
1.
Exchange with your neighbor and compare what you have written. Are your algorithms the same? Are they both computer executable? Is there anything you are missing?
3. For this exercise you will work with a partner. Start by introducing yourself to each other.
- Turn away from your partner so you cannot see their worksheet and draw something in the box below on the left. Do not look at what your partner is drawing!
- On a separate sheet of paper, write an algorithm explaining how to recreate the drawing.
- Exchange instructions with your partner. Follow your partner’s instructions to recreate their drawing in the box on the right.
- Compare your drawings. How well does what you drew match up with what they originally drew? How can your improve your instructions?
A program is a sequence of instructions that specifies how to perform a computation.
1. What are the five basic types of instructions used by Python (and nearly every other programming language)?
2. What is the output of the following statements? If an error occurs, which type of error?
print("I am so excited to learn Python!")
print("six times seven is . . . ")
6 + 7
print("Hello, world"
print("the chance of precipitation today is:")
print(7 / 10 * 100)
print("%")
16 / (5 - 5)