comp 171: principles of computer science i john barr
TRANSCRIPT
![Page 1: COMP 171: Principles of Computer Science I John Barr](https://reader035.vdocuments.site/reader035/viewer/2022081506/56649e995503460f94b9c71b/html5/thumbnails/1.jpg)
COMP 171: Principles of Computer Science IJohn Barr
![Page 2: COMP 171: Principles of Computer Science I John Barr](https://reader035.vdocuments.site/reader035/viewer/2022081506/56649e995503460f94b9c71b/html5/thumbnails/2.jpg)
What is Computer Science?
Problem Solving
Understanding the problem/challenge
Breaking down the problem into solvable pieces
Using the tools you have to solve the problem
![Page 3: COMP 171: Principles of Computer Science I John Barr](https://reader035.vdocuments.site/reader035/viewer/2022081506/56649e995503460f94b9c71b/html5/thumbnails/3.jpg)
What is Computer Science?
Solution: An Algorithm
Step-by-step procedure to solve the problem from beginning (start state) to end (end state)
![Page 4: COMP 171: Principles of Computer Science I John Barr](https://reader035.vdocuments.site/reader035/viewer/2022081506/56649e995503460f94b9c71b/html5/thumbnails/4.jpg)
What is Computer Science?
For CS, algorithms need to be expressed in a form the computer can understand.
Programming LanguageYour way to tell the computer your algorithm
(your solution) Computer will only do what you tell it to do
![Page 5: COMP 171: Principles of Computer Science I John Barr](https://reader035.vdocuments.site/reader035/viewer/2022081506/56649e995503460f94b9c71b/html5/thumbnails/5.jpg)
Our Programming Language: Python - Version 3.x
Powerful, but easy to use
Interpreted Language (not compiled)Simple syntaxRuns immediately (but slightly slower)
Allows for Rapid Prototyping
![Page 6: COMP 171: Principles of Computer Science I John Barr](https://reader035.vdocuments.site/reader035/viewer/2022081506/56649e995503460f94b9c71b/html5/thumbnails/6.jpg)
Our Course
Learn to solve problems with computers by creating algorithms, and translating those algorithms in Python code.
Give the computer instructions to solve instances of the problem for us.
![Page 7: COMP 171: Principles of Computer Science I John Barr](https://reader035.vdocuments.site/reader035/viewer/2022081506/56649e995503460f94b9c71b/html5/thumbnails/7.jpg)
Typical Weekly Schedule
M TU W TH F SA SU
New Topic New Lab
Deeper into new topic
Extra challenge
Working on lab Reading / Working on Homework
Homework Due
Lab due
Quiz
Our Course
![Page 8: COMP 171: Principles of Computer Science I John Barr](https://reader035.vdocuments.site/reader035/viewer/2022081506/56649e995503460f94b9c71b/html5/thumbnails/8.jpg)
Sakai for Class Information
Syllabus Textbook Assignments TA hours Class web site Other resources
Start Python download now… Python 3.x
![Page 9: COMP 171: Principles of Computer Science I John Barr](https://reader035.vdocuments.site/reader035/viewer/2022081506/56649e995503460f94b9c71b/html5/thumbnails/9.jpg)
Our Book / Homework System
Interactive Python, by Runestone InteractiveGoogle “Interactive Python”To create an account, scroll to the very bottom of this
page, and click the small blue "register" link.
The course name is:
IC-Comp-17-FA-14 After, submit your username on Sakai
![Page 10: COMP 171: Principles of Computer Science I John Barr](https://reader035.vdocuments.site/reader035/viewer/2022081506/56649e995503460f94b9c71b/html5/thumbnails/10.jpg)
Starting with Python - IDLE
The environment we will use to create and run python programs
Very simple
Downloads with python
![Page 11: COMP 171: Principles of Computer Science I John Barr](https://reader035.vdocuments.site/reader035/viewer/2022081506/56649e995503460f94b9c71b/html5/thumbnails/11.jpg)
IDLE: Using the shell>>> 2+2
4
>>> print "Hello, World"
Hello, World
Tinkering in the shell is fine, but when you want to maintain / save / share your work, use a module.
![Page 12: COMP 171: Principles of Computer Science I John Barr](https://reader035.vdocuments.site/reader035/viewer/2022081506/56649e995503460f94b9c71b/html5/thumbnails/12.jpg)
Creating a module
print “Running Module” def main(): #comment inside module print ("Hello, World”)
main()
• Select “Run > Run Module” (save the file as “HelloWorld”)• A shell will open up with your program loaded
In IDLE:• Select “File -> New Window”
• or “File->New File” on a Mac• This new window is a “module”• Type the following: