Skip to content

Instantly share code, notes, and snippets.

@travs
Created May 26, 2018 22:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save travs/ef674d6462f8229a5641ac53a11daafd to your computer and use it in GitHub Desktop.
Save travs/ef674d6462f8229a5641ac53a11daafd to your computer and use it in GitHub Desktop.

COSC 101: Fall 2017
Lecture 01: Computational Thinking & Introduction to Python

Computational Thinking

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:

  1. Wet the toothbrush

  2. Put toothpaste on the toothbrush

  3. Brush each side of your teeth for 30 seconds

  4. Spit

  5. 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.

  1. 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!

  2. On a separate sheet of paper, write an algorithm explaining how to recreate the drawing.

  3. Exchange instructions with your partner. Follow your partner’s instructions to recreate their drawing in the box on the right.

  4. Compare your drawings. How well does what you drew match up with what they originally drew? How can your improve your instructions?  
    blank boxes for drawings  
     
     
     
     

Introduction to Python Programming

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)

 
 
 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment