Why Program? Computers want to be helpful... Programmers Anticipate Needs. Chapter 1. Computers are built for one purpose - to do things for us

Size: px
Start display at page:

Download "Why Program? Computers want to be helpful... Programmers Anticipate Needs. Chapter 1. Computers are built for one purpose - to do things for us"

Transcription

1 Why Program? Chapter 1 Unless otherwise noted, the content of this course material is licensed under a Creative Commons Attribution 3.0 License. Copyright 2010, Charles Severance Python for Informatics: Exploring Information Computers want to be helpful... Programmers Anticipate Needs Computers are built for one purpose - to do things for us But we need to speak their language to describe what we want done Users have it easy - someone already put many different programs (instructions) into the computer and users just pick the ones we want to use iphone Applications are a market iphone Applications just reached 3 Billion downloads Programmers have left their jobs to be full-time iphone developers Programmers know the ways of the program Pick Me! Pick Me! Pick Me! Pick Me! Pick Me! Pay Me!

2 Users.vs. Programmers Users see computers as a set of tools - word processor, spreadsheet, map, todo list, etc. Programmers learn the compter ways and the computer language Programmers have some tools that allow them to build new tools Programmers sometimes write tools for lots of users and sometimes programmers write little helpers for themselves to automate a task Data User Computer Hardware + Software Information... Networks From a software creator s point of view, we build the software. The end users (stakeholders/actors) are our masters - who we want to please - often they pay us money when they are pleased. But the data, information, and networks are our problem to solve on their behalf. The hardware and software are our friends and allies in this quest. Programmer Why be a programer? To get some task done - we are the user and programmer Clean up survey data Fix a performance problem in the Sakai software Add guestbook to a web site To produce something for others to use - a programming job is Code? Software? A Program? A set of stored instructions It is a little piece of our intelligence in the computer It is a little piece of our intelligence we can give to others - we figure something out and then we encode it and then give it to someone else to save them the time and energy of figuring it out A piece of creative art - particularly when we do a good job on user experience

3 Writing programs (or programming) is a very creative and rewarding activity. You can write programs for many reasons ranging from making your living to solving a difficult data analysis problem to having fun to helping someone else solve a problem. This book assumes that everyone needs to know how to program and that once you know how to program, you will figure out what you want to do with your newfound skills. We are surrounded in our daily lives with computers ranging from laptops to cell phones. We can think of these computers as our ``personal assistants'' who can take care of many things on our behalf. The hardware in our current-day computers is essentially built to continuously ask us the question, `` would you like me to do next?''. Our computers are fast and have vasts amounts of memory and could be very helpful to us if we only knew the language to speak to explain to the computer what we would like it to ``do next''. If we knew this language we could tell the computer to do tasks on our behalf that were reptitive. Interestingly, the kinds of things computers can do best are often the kinds of things that we humans find boring and mind-numbing. name = raw_input("enter file:") handle = open(name, "r") text = handle.read() words = text.split() counts = dict() for word in words: counts[word] = counts.get(word,0) + 1 bigcount = None bigword = None for word,count in counts.items(): if bigcount == None or count > bigcount: bigword = word bigcount = count print bigword, bigcount python words.py Enter file: words.txt to 16 Software Generic Computer Hardware Architecture Input and Output Devices Central Processing Unit Secondary Memory Main Memory

4 Definitions Software Generic Computer Central Processing Unit: Runs the Program - The CPU is always wondering what to do next? Not the brains exactly - very dumb but very very fast Input Devices: Keyboard, Mouse, Touch Screen Output Devices: Screen, Speakers, Printer, DVD Burner Main Memory: Fast small temporary storage - lost on reboot - aka RAM Secondary Memory: Slower large permanent storage - lasts until deleted - disk drive / memory stick Input and Output Devices Central Processing Unit Main Memory if x< 3: print Secondary Memory Software Terms Input and Output Devices Central Processing Unit Secondary Memory Source code - the programs we humans write - and read - written in a programming language - source code is generally portable across systems Main Memory Machine Language Machine code - what really runs on the machine - not very readible - produced by a compiler - machine code is unique to hardware and operating system - Windows machine code is different from Macintosh machine code.

5 Programmer Tools Programmer Tools Since the Central Processing Unit must ran Machine Code, we must translate our source code to machine code Compiler - Takes our source code and makes a machine code version of our program Interpreter - Reads our source code and runs it directly - Python is an interpreted language - Python is an interpreter Input Data Input Data A programmer develops a program. If a compiler is used the compiler translated the source to machine code for distribution. If an interpreter is used, the programmer simply distributes the source code. Compiler.vs. Interpreter Only the programmer needs to have the compiler - once the compiler is done - the machine code program is self-contained The programmer keeps the source code and distributes the machine code - different machine code is needed for Mac, PC, etc. Both the programmer and user need to have the interpreter installed on their system Generally the programmer distributes the source code of the program

6 main() { printf("hello world\n"); } ^@^@^@^@ nl_symbol_ ptr^@ DATA^@^@^@^@^@^@^@^@^@^@ ^@^@0t^@^@^@^P^@^@ t^@^@^@^b^@^@^@^@^@^@^@^@^@^@^@ ^F^@^@^@^Q^@^@^@^@ la_symbol_p tr^@ lib/ libmx.a.dylib^@^@^@^@^@^l^@^@^@ 4^@^@^@^XC½m ^@X^A^C^@^A^@^@/ usr/lib/libsy Hello world Your Source Code in the C Language The C Language Compiler Reads your source code and produces your machine code. Your Machine Code ^?ELF^A^A^A^@^@^@^@^@^@^@^@^@^B^@^C^@^A^@^@^@\xa0\x82^D^H4^@^@^@\x90^]^@^@^@^@^@ ^@4^@ ^@^G^@(^@$^@!^@^F^@^@^@4^@^@^@4\x80^D^H4\x80^D^H\xe0^@^@^@\xe0^@^@^@^E^@^@ ^@^D^@^@^@^C^@^@^@^T^A^@^@^T\x81^D^H^T\x81^D^H^S^@^@^@^S^@^@^@^D^@^@^@^A^@^@^@^A\ ^D^HQVhT\x83^D^H\xe8\xb7\xff\xff\xff\xf4\x90\x90U\x89\xe5S\xe8^@^@^@^@[\x81\xc3_ ^R^@^@P\x8b\x83\xfc\xff\xff\xff\x85\xc0t^B\xff\xd0\x8b]\xfc\xc9\xc3\x90\x90\x90\ x90\x90\x90\x90\x90\x90\x90u\x89\xe5\x83\xec^h\x80=l\x95^d^h^@t^l\xeb^\\x83\xc0^ D\xa3H\x95^D^H\xff\xd2\xa1H\x95^D^H\x8b^P\x85\xd2u\xeb\xc6^EL\x95^D^H^A\xc9\xc3\ x90u\x89\xe5\x83\xec^h\xa1\\x94^d^h\x85\xc0t!\xb8^@^@^@^@\x85\xc0t^x\xc7^d$\\x94 ^D^H\xe8\xbc \xfb\xf7\x8d\xb6^@^@^@^@\x8d\xbf^@^@^@^@\xc9\xc3\x90\x90u\x89\xe5\x print hello world Hello world è^@^@^qp^@^@^@^b^@^@^@^@^@^@^@^@<80>^@^d^@^@^@^@^@^@^@^@^@ picsy mbol_stub TEXT^@^@^@^@^@^@^@^@^@^@^@^@,X^@^@^@^@^@^@^ \X^@^@^@^B^@^@^@^@^@^@^@^@<80>^@^@^H^@^@^@^@^@^@^@ $ symbol_stub^@^@^@ TEXT^@^@^@^@^@^@^@^@^@^@^@^@,X^@^@^@^@^@^@^ \X^@^@^@^B^@^@^@^@^@^@^@^@<80>^@^@^H^@^@^@^@^@^@^@^T picsymbolst ub1 TEXT^@^@^@^@^@^@^@^@^@^@^@^@,`^@^@^B ^@^@^ \`^@^@^@^E^@^@^@^@^@^@^@^@<80>^@^D^H^@^@^@^@^@^@^@ cstring^@^@^@^@^@^@^@ TEXT^@^@^@^@^@^@^@^@^@^@^@^@.<80>^@^@^AX Machine ^@^@^^<80>^@^@^@^B^@^@^@^@^@^@^@^@^@^@^@^B^@^@^@^@^@^@^@^@^@^@^@^ A^@^@^AÐ DATA^@^@^@^@^@^@^@^@^@^@^@^@0^@^@^@^P^@^@^@ Code ^@^@^@^P^@^@^@^@^G^@^@^@^C^@^@^@^F^@^@^@^@ DATA^@^@^@^@^@^@^@^@^@^@^@^@0^@^@^@^@q^@^@ for the ^@^@^@^@^B^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@ nl_symbol_ptr ^@ DATA^@^@^@^@^@^@^@^@^@^@^@^@0t^@^@^@^P^@^@ Python t^@^@^@^b^@^@^@^@^@^@^@^@^@^@^@^f^@^@^@^q^@^@^@^@ DATA^@^@^@^@^@^@^@^@^@^@^@^@0<84>^@^@^@D^@^@ Interpreter <84>^@^@^@^B^@^@^@^@^@^@^@^@^@^@^@^G^@^@^@^U^@^@^@^@ DATA^@^@^@^@^@^@^@^@^@^@^@^@0È^@^@^@^\^@^@ È^@^@^@^B^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@ DATA^@^@^@^@^@^@^@^@^@^@^@^@0ä^@^@^@^D^@^@^@^@^@^@^@ ^B^@^@^@^@^@^@^@^@^@^@^@^A^@^@^@^@^@^@^@^@ Python is an Interpreter To run Python programs, users must install Python on their computers Development is quick and easy - we simply make a change to our program and run it again in a single step For data analysis - Python is just a tool that you keep on your computer Interpreters are more convenient when the user and programmer are the same person

7 Python Interactive Running Python Interactively Since Python is interpreted we can just type programs directly into Python See Also x=1 print x x = x + 1 >>> x = 1 >>> print x 1 >>> x = x + 1 >>> next? csev$ python Python 2.5 (r25:51918, Sep , 08:49:13) [GCC (Apple Computer, Inc. build 5341)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> x = 1 >>> print x 1 >>> x = x + 1 >>> print x 2 >>> exit() This is a good test to make sure that you have Python correctly installed. Python Scripts Interactive Python is good for experiments and programs of 3-4 lines long But most programs are much longer so we type them into a file and tell python to run the commands in the file. In a sense we are giving Python a script As convention, we add.py as the suffix on the end of these files to indicate they contain Python

8 Python as a Language Parseltongue is the language of serpents and those who can converse with them. An individual who can speak Parseltongue is known as a Parselmouth. It is a very uncommon skill, and may be hereditary. Nearly all known Parselmouths are descended from Salazar Slytherin. Python is the language of the Python Interpreter and those who can converse with it. An individual who can speak Python is known as a Pythonista. It is a very uncommon skill, and may be hereditary. Nearly all known Pythonistas use software inititially developed by Guido van Rossum. Early Learner: Syntax Errors We need to learn the Python language so we can communicate our instructions to Python. In the beginning we will make lots of mistakes and speak gibberish like small children. When you make a mistake, the computer does not think you are cute. It says syntax error - given that it *knows* the language and you are just learning it. It seems like Python is cruel and unfeeling. You must remember that you are intelligent and *can* learn - the computer is simple and very fast - but cannot learn - so it is easier for you to learn Python than for the computer to learn English...

9 Elements of Python Vocabulary / Words - Variables and Reserved words (Chapter 2) Sentance structure - valid syntax patterns (Chapters 3-5) Story structure - constructing a program for a a purpose name = raw_input("enter file:") handle = open(name, "r") text = handle.read() words = text.split() counts = dict() for word in words: counts[word] = counts.get(word,0) + 1 bigcount = None bigword = None for word,count in counts.items(): if bigcount == None or count > bigcount: bigword = word bigcount = count print bigword, bigcount A short Story about how to count words in a file in Python. python words.py Enter file: words.txt to 16 Reserved Words You can not use reserved words as variable names / identifiers and del for is raise assert elif from lambda return break else global not try class except if or while continue exec import pass yield def finally in print Chapter 2 Sentances or Lines x = 2 Assignment Statement x = x + 2 Assignment with expression print x Print statement Variable Operator Constant Reserved Word

10 Program Steps or Program Flow Programming Paragraphs Like a recipe or installation instructions, a program is a sequence of steps to be done in order Some steps are conditional - they may be skipped Sometimes a step or group of steps are to be repeated Sometimes we store a set of steps to be used over and over as needed several places throughout the program Sequential Steps x = 5 Conditional Steps x = 1 print x x = x + 1 print x Program: x = 2 print x x = x + 2 print x Output: 2 4 X < 10? X > 20? Yes print Smaller Yes print Bigger Program: x = 5 if x < 10: print "Smaller" if x > 20: print "Bigger" Output: Smaller Finis When a program is running, it flows from one step to the next. We as programmers set up paths for the program to follow. Chapter 2 print Finis print Finis Chapter 3

11 Done i = print Bye print i Repeated Steps Program: for i in range(5) : print i print Bye Output: Bye Loops (repeated steps) have iteration variables that change each time through a loop. Often these iteration variables go through a sequence of numbers. Chapter 5 def hello() print Zip hello() Stored (and reused) Steps hello(): print Hello print Fun Program: def hello(): print "Hello" print "Fun" hello() print Zip hello() We call these reusable pieces of code functions. Output: Hello Fun Zip Hello Fun Chapter 4 name = raw_input("enter file:") handle = open(name, "r") text = handle.read() words = text.split() counts = dict() for word in words: counts[word] = counts.get(word,0) + 1 bigcount = None bigword = None for word,count in counts.items(): if bigcount == None or count > bigcount: bigword = word bigcount = count print bigword, bigcount Sequential Repeated Conditional An Animated Short Story... Finding the largest number in a list of numbers...

12 is the Largest Number? is the Largest Number? is the Largest Number? is the Largest Number? largest_so_far

13 name = raw_input("enter file:") handle = open(name, "r") text = handle.read() words = text.split() counts = dict() for word in words: counts[word] = counts.get(word,0) + 1 bigcount = None bigword = None for word,count in counts.items(): if bigcount == None or count > bigcount: bigword = word bigcount = count print bigword, bigcount A short Story about how to count words in a file in Python. A word used to read data from a user. A sentance about updating one of many counts. A paragraph about how to find the largest item in a list. Tao of Programming... In the first phase, you hate the computer and you hate Python. It seems that no matter what you do, Python always tells you Syntax error or Trace Back. In the second phase, you realize that when Python is telling you Syntax error or Traceback, it means that Python has become confused and does not know what to do next. Python is kind of like a puppy. In the third phase, you realize that Python is actually a great help to you and that Python represents the collective intelligence of hundreds of programmers who have given you some powerful and brilliant tools and capabilities. When you face a problem you are not alone. Summary This is a quick overview of Chapter 1 Focus on the big picture We will revisit these concepts throughout the course

Constants. Variables, Expressions, and Statements. Variables. x = 12.2 y = 14 x = 100. Chapter

Constants. Variables, Expressions, and Statements. Variables. x = 12.2 y = 14 x = 100. Chapter Variables, Expressions, and Statements Chapter 2 Unless otherwise noted, the content of this course material is licensed under a Creative Commons Attribution 3.0 License. http://creativecommons.org/licenses/by/3.0/.

More information

Variables, Expressions, and Statements

Variables, Expressions, and Statements Variables, Expressions, and Statements Chapter 2 Python for Informatics: Exploring Information www.pythonlearn.com Constants Fixed values such as numbers, letters, and strings are called constants because

More information

Fundamentals of Programming (Python) Basic Concepts. Ali Taheri Sharif University of Technology Spring 2018

Fundamentals of Programming (Python) Basic Concepts. Ali Taheri Sharif University of Technology Spring 2018 Fundamentals of Programming (Python) Basic Concepts Ali Taheri Sharif University of Technology Outline 1. What is a Computer? 2. Computer System Organization 3. What is a Computer Program? 4. Programming

More information

Conditional Execution

Conditional Execution Conditional Execution Chapter 3 Python for Informatics: Exploring Information www.py4inf.com Unless otherwise ted, the content of this course material is licensed under a Creative Commons Attribution 3.0

More information

Python for Informatics

Python for Informatics Python for Informatics Exploring Information Version 2.7.3 Charles Severance Copyright 2009- Charles Severance. Printing history: May 2015: Editorial pass thanks to Sue Blumenberg. October 2013: Major

More information

Dictionaries, Text, Tuples

Dictionaries, Text, Tuples Dictionaries, Text, Tuples 4 We re Familiar with Lists [2, 3, 51, 0] [[ a, 151], [ z, 23], [ i, -42.3]] [2, BBC, KCRW, [ z, 23]] Lists enable us to store multiple values in one variable Lists are ordered,

More information

Starting from. An Introduction to Computing Science by Jeremy Scott LEARNER NOTES

Starting from. An Introduction to Computing Science by Jeremy Scott LEARNER NOTES Starting from An to Computing Science by Jeremy Scott LEARNER NOTES You have probably already used several computers today without realising it. If you have sent a text, been driven in a car, or checked

More information

Jython. secondary. memory

Jython. secondary. memory 2 Jython secondary memory Jython processor Jython (main) memory 3 Jython secondary memory Jython processor foo: if Jython a

More information

STEAM Clown & Productions Copyright 2017 STEAM Clown. Page 1

STEAM Clown & Productions Copyright 2017 STEAM Clown. Page 1 What to add next time you are updating these slides Update slides to have more animation in the bullet lists Verify that each slide has stand alone speaker notes Page 1 Python 3 Running The Python Interpreter

More information

Week One: Introduction A SHORT INTRODUCTION TO HARDWARE, SOFTWARE, AND ALGORITHM DEVELOPMENT

Week One: Introduction A SHORT INTRODUCTION TO HARDWARE, SOFTWARE, AND ALGORITHM DEVELOPMENT Week One: Introduction A SHORT INTRODUCTION TO HARDWARE, SOFTWARE, AND ALGORITHM DEVELOPMENT Outline In this chapter you will learn: About computer hardware, software and programming How to write and execute

More information

There are two ways to use the python interpreter: interactive mode and script mode. (a) open a terminal shell (terminal emulator in Applications Menu)

There are two ways to use the python interpreter: interactive mode and script mode. (a) open a terminal shell (terminal emulator in Applications Menu) I. INTERACTIVE MODE VERSUS SCRIPT MODE There are two ways to use the python interpreter: interactive mode and script mode. 1. Interactive Mode (a) open a terminal shell (terminal emulator in Applications

More information

Elements of Computers and Programming Dr. William C. Bulko. What is a Computer?

Elements of Computers and Programming Dr. William C. Bulko. What is a Computer? Elements of Computers and Programming Dr. William C. Bulko What is a Computer? 2017 What is a Computer? A typical computer consists of: a CPU memory a hard disk a monitor and one or more communication

More information

Intro. Scheme Basics. scm> 5 5. scm>

Intro. Scheme Basics. scm> 5 5. scm> Intro Let s take some time to talk about LISP. It stands for LISt Processing a way of coding using only lists! It sounds pretty radical, and it is. There are lots of cool things to know about LISP; if

More information

Computing and compilers

Computing and compilers Computing and compilers Comp Sci 1570 to Outline 1 2 3 4 5 Evaluate the difference between hardware and software Find out about the various types of software Get a high level understanding of how program

More information

CS150 Introduction to Computer Science 1. What is CS150? Who Are We? CS150 is a programming course You will learn

CS150 Introduction to Computer Science 1. What is CS150? Who Are We? CS150 is a programming course You will learn CS 150 Introduction to Computer Science 1 Professor: Shereen Khoja shereen@pacificu.edu 1 What is CS150? CS150 is a programming course You will learn o The mechanics of writing programs in C++ o How to

More information

mith College Computer Science Week 12 CSC111 Spring 2018 Dominique Thiébaut

mith College Computer Science Week 12 CSC111 Spring 2018 Dominique Thiébaut mith College Computer Science Week 12 CSC111 Spring 2018 Dominique Thiébaut dthiebaut@smith.edu http://www.science.smith.edu/dftwiki/index.php/ Nice_Wrapping_Paper... Polymorphism Dictionaries & Recursion

More information

Welcome to Python! If you re the type of person who wants to know

Welcome to Python! If you re the type of person who wants to know In This Chapter The history of Python What people use Python for Chapter 1 Introducing Python Useful concepts for Python programming Welcome to Python! If you re the type of person who wants to know what

More information

CHAPTER 2: Introduction to Python COMPUTER PROGRAMMING SKILLS

CHAPTER 2: Introduction to Python COMPUTER PROGRAMMING SKILLS CHAPTER 2: Introduction to Python COMPUTER PROGRAMMING SKILLS 1439-1440 1 Outline 1. Introduction 2. Why Python? 3. Compiler and Interpreter 4. The first program 5. Comments and Docstrings 6. Python Indentations

More information

There are two ways to use the python interpreter: interactive mode and script mode. (a) open a terminal shell (terminal emulator in Applications Menu)

There are two ways to use the python interpreter: interactive mode and script mode. (a) open a terminal shell (terminal emulator in Applications Menu) I. INTERACTIVE MODE VERSUS SCRIPT MODE There are two ways to use the python interpreter: interactive mode and script mode. 1. Interactive Mode (a) open a terminal shell (terminal emulator in Applications

More information

Python for Everybody. Exploring Data Using Python 3. Charles R. Severance

Python for Everybody. Exploring Data Using Python 3. Charles R. Severance Python for Everybody Exploring Data Using Python 3 Charles R. Severance Credits Editorial Support: Elliott Hauser, Sue Blumenberg Cover Design: Aimee Andrion Printing History 2016-Jul-05 First Complete

More information

Introduction to Computer Programming for Non-Majors CSC 2301, Fall The Department of Computer Science

Introduction to Computer Programming for Non-Majors CSC 2301, Fall The Department of Computer Science Introduction to Computer Programming for Non-Majors CSC 2301, Fall 2015 The Department of Computer Science CSC 2301 Welcome to Class CSC 2301! Introduction to Computer Programming for Non-Majors Who are

More information

Variables, expressions and statements

Variables, expressions and statements Variables, expressions and statements 2.1. Values and data types A value is one of the fundamental things like a letter or a number that a program manipulates. The values we have seen so far are 2 (the

More information

Conditional Execution

Conditional Execution Conditional Execution Chapter 3 Python for Informatics: Exploring Information www.pythonlearn.com x = 5 X < 10? Yes Conditional Steps Program: No print 'Smaller' x = 5 Output: if x < 10: X > 20? Yes print

More information

Word processing and spreadsheet applications are among the most

Word processing and spreadsheet applications are among the most In This Chapter Chapter 1 Starting Out with iwork 09 Leaving the past behind The iwork timesavers: Do it once, do it right, and reuse it Word processing and spreadsheet applications are among the most

More information

Review. Input, Processing and Output. Review. Review. Designing a Program. Typical Software Development cycle. Bonita Sharif

Review. Input, Processing and Output. Review. Review. Designing a Program. Typical Software Development cycle. Bonita Sharif Input, Processing and Output Bonita Sharif 1 Review A program is a set of instructions a computer follows to perform a task The CPU is responsible for running and executing programs A set of instructions

More information

Chris Simpkins (Georgia Tech) CS 2316 Data Manipulation for Engineers Python Overview 1 / 9

Chris Simpkins (Georgia Tech) CS 2316 Data Manipulation for Engineers Python Overview 1 / 9 http://xkcd.com/353/ Chris Simpkins (Georgia Tech) CS 2316 Data Manipulation for Engineers Python Overview 1 / 9 Python Python is a general-purpose programming language, meaning you can write any kind

More information

Privacy and Security in Online Social Networks Department of Computer Science and Engineering Indian Institute of Technology, Madras

Privacy and Security in Online Social Networks Department of Computer Science and Engineering Indian Institute of Technology, Madras Privacy and Security in Online Social Networks Department of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 04 Tutorial 1, Part 1 Ubuntu Hi everyone, welcome to the first

More information

Getting Started. Excerpted from Hello World! Computer Programming for Kids and Other Beginners

Getting Started. Excerpted from Hello World! Computer Programming for Kids and Other Beginners Getting Started Excerpted from Hello World! Computer Programming for Kids and Other Beginners EARLY ACCESS EDITION Warren D. Sande and Carter Sande MEAP Release: May 2008 Softbound print: November 2008

More information

Programming: detailed instructions which tell the computer hardware what to do aka software Computer Science: the study NOT of computers, but of what

Programming: detailed instructions which tell the computer hardware what to do aka software Computer Science: the study NOT of computers, but of what Programming: detailed instructions which tell the computer hardware what to do aka software Computer Science: the study NOT of computers, but of what can be computed what processes a computer can execute

More information

Table of Contents EVALUATION COPY

Table of Contents EVALUATION COPY Table of Contents Introduction... 1-2 A Brief History of Python... 1-3 Python Versions... 1-4 Installing Python... 1-5 Environment Variables... 1-6 Executing Python from the Command Line... 1-7 IDLE...

More information

Chapter 2 Writing Simple Programs

Chapter 2 Writing Simple Programs Chapter 2 Writing Simple Programs Charles Severance Textbook: Python Programming: An Introduction to Computer Science, John Zelle (www.si182.com) Software Development Process Figure out the problem - for

More information

Programming with Python

Programming with Python Programming with Python Dr Ben Dudson Department of Physics, University of York 21st January 2011 http://www-users.york.ac.uk/ bd512/teaching.shtml Dr Ben Dudson Introduction to Programming - Lecture 2

More information

Beyond Blocks: Python Session #1

Beyond Blocks: Python Session #1 Beyond Blocks: Session #1 CS10 Spring 2013 Thursday, April 30, 2013 Michael Ball Beyond Blocks : : Session #1 by Michael Ball adapted from Glenn Sugden is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike

More information

Game keystrokes or Calculates how fast and moves a cartoon Joystick movements how far to move a cartoon figure on screen figure on screen

Game keystrokes or Calculates how fast and moves a cartoon Joystick movements how far to move a cartoon figure on screen figure on screen Computer Programming Computers can t do anything without being told what to do. To make the computer do something useful, you must give it instructions. You can give a computer instructions in two ways:

More information

Software Development. Integrated Software Environment

Software Development. Integrated Software Environment Software Development Integrated Software Environment Source Code vs. Machine Code What is source code? Source code and object code refer to the "before" and "after" versions of a computer program that

More information

Software Compare and Contrast

Software Compare and Contrast Microsoft Software Compare and Contrast Word Easy to navigate. Compatible with all PC computers. Very versatile. There are lots of templates that can be used to create flyers, calendars, resumes, etc.

More information

Week - 01 Lecture - 04 Downloading and installing Python

Week - 01 Lecture - 04 Downloading and installing Python Programming, Data Structures and Algorithms in Python Prof. Madhavan Mukund Department of Computer Science and Engineering Indian Institute of Technology, Madras Week - 01 Lecture - 04 Downloading and

More information

Intro to Programming. Unit 7. What is Programming? What is Programming? Intro to Programming

Intro to Programming. Unit 7. What is Programming? What is Programming? Intro to Programming Intro to Programming Unit 7 Intro to Programming 1 What is Programming? 1. Programming Languages 2. Markup vs. Programming 1. Introduction 2. Print Statement 3. Strings 4. Types and Values 5. Math Externals

More information

Python for Non-programmers

Python for Non-programmers Python for Non-programmers A Gentle Introduction 1 Yann Tambouret Scientific Computing and Visualization Information Services & Technology Boston University 111 Cummington St. yannpaul@bu.edu Winter 2013

More information

CSC 015: FUNDAMENTALS OF COMPUTER SCIENCE I

CSC 015: FUNDAMENTALS OF COMPUTER SCIENCE I CSC 015: FUNDAMENTALS OF COMPUTER SCIENCE I Lecture 1: Class Introduction DR. BO TANG ASSISTANT PROFESSOR HOFSTRA UNIVERSITY 1 9/7/16 CSC15 - Python OUTLINE What is Computer Science? What is this Class

More information

! Learn how to think like a computer scientist. ! Learn problem solving. ! Read and write code. ! Understand object oriented programming

! Learn how to think like a computer scientist. ! Learn problem solving. ! Read and write code. ! Understand object oriented programming 1 TOPIC 1 INTRODUCTION TO COMPUTER SCIENCE AND PROGRAMMING Topic 1 Introduction to Computer Science and Programming Notes adapted from Introduction to Computing and Programming with Java: A Multimedia

More information

CSCE 110 Programming I Basics of Python: Variables, Expressions, Input/Output

CSCE 110 Programming I Basics of Python: Variables, Expressions, Input/Output CSCE 110 Programming I Basics of Python: Variables, Expressions, Input/Output Dr. Tiffani L. Williams Department of Computer Science and Engineering Texas A&M University Spring 2011 Python Python was developed

More information

Problem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur

Problem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Problem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Lecture - 04 Introduction to Programming Language Concepts

More information

Computer Fundamentals

Computer Fundamentals Computer Fundamentals 1 Draw the block diagram of computer architecture and explain each block. Computer is made up of mainly four components, 1) Central processing unit (CPU) 2) Input section 3) Output

More information

Assignment 1 What is a Computer?

Assignment 1 What is a Computer? Assignment 1 What is a Computer? Hello, I'm PC. Read about the computer. Answer the questions. A computer is a tool that runs programs. The computer is sometimes called a "personal computer" or PC for

More information

CSCE 110 Programming I

CSCE 110 Programming I CSCE 110 Programming I Basics of Python (Part 1): Variables, Expressions, and Input/Output Dr. Tiffani L. Williams Department of Computer Science and Engineering Texas A&M University Spring 2013 Tiffani

More information

Creating a new form with check boxes, drop-down list boxes, and text box fill-ins. Customizing each of the three form fields.

Creating a new form with check boxes, drop-down list boxes, and text box fill-ins. Customizing each of the three form fields. In This Chapter Creating a new form with check boxes, drop-down list boxes, and text box fill-ins. Customizing each of the three form fields. Adding help text to any field to assist users as they fill

More information

INFORMATION COMUNICATION TECHNOLOGY SKS Lecture Two

INFORMATION COMUNICATION TECHNOLOGY SKS Lecture Two INFORMATION COMUNICATION TECHNOLOGY SKS 1362 Lecture Two Microprocessor CPU: Central Processing Unit Brain of the computer Executes instructions 2 Microprocessor CPU: It has mathematical function Calculates

More information

Getting Started with Python

Getting Started with Python Fundamentals of Programming (Python) Getting Started with Python Sina Sajadmanesh Sharif University of Technology Some slides have been adapted from Python Programming: An Introduction to Computer Science

More information

Python - Conditional Execution

Python - Conditional Execution Python - Conditional Execution x = 5 X < 10? Yes Conditional Steps Program: print 'Smaller' x = 5 Output: if x < 10: X > 20? Yes print 'Smaller Smaller Finis print 'Bigger' if x > 20: print 'Bigger' print

More information

C H A P T E R 1. Introduction to Computers and Programming

C H A P T E R 1. Introduction to Computers and Programming C H A P T E R 1 Introduction to Computers and Programming Topics Introduction Hardware and Software How Computers Store Data How a Program Works Using Python Computer Uses What do students use computers

More information

EECS 282 Information Systems Design and Programming. Atul Prakash Professor, Computer Science and Engineering University of Michigan

EECS 282 Information Systems Design and Programming. Atul Prakash Professor, Computer Science and Engineering University of Michigan EECS 282 Information Systems Design and Programming Atul Prakash Professor, Computer Science and Engineering University of Michigan 1 What is the Course About? A second programming course - but different

More information

Starting. Read: Chapter 1, Appendix B from textbook.

Starting. Read: Chapter 1, Appendix B from textbook. Read: Chapter 1, Appendix B from textbook. Starting There are two ways to run your Python program using the interpreter 1 : from the command line or by using IDLE (which also comes with a text editor;

More information

CircuitPython 101: Working with Lists, Iterators and Generators

CircuitPython 101: Working with Lists, Iterators and Generators CircuitPython 101: Working with Lists, Iterators and Generators Created by Dave Astels Last updated on 2018-11-01 12:06:56 PM UTC Guide Contents Guide Contents Overview List Functions Slicing Filtering

More information

Introduction to Programming

Introduction to Programming Introduction to Programming Computers and Programs Python Programming, 1/e 1 The Universal Machine What is a computer program? A detailed, step-by-step set of instructions telling a computer what to do.

More information

1.1 Introduction. Fig.1.1 Abstract view of the components of a computer system.

1.1 Introduction. Fig.1.1 Abstract view of the components of a computer system. 1.1 Introduction An operating system is a program that manages the computer hardware. It also provides a basis for application programs and acts as an intermediary between a user of a computer and the

More information

Chapter One: Introduction A SHORT INTRODUCTION TO HARDWARE, SOFTWARE, AND ALGORITHM DEVELOPMENT

Chapter One: Introduction A SHORT INTRODUCTION TO HARDWARE, SOFTWARE, AND ALGORITHM DEVELOPMENT Chapter One: Introduction A SHORT INTRODUCTION TO HARDWARE, SOFTWARE, AND ALGORITHM DEVELOPMENT Chapter Goals In this chapter you will earn: About computer hardware, so8ware and programming How to write

More information

EECS 282 Information Systems Design and Programming. Atul Prakash Professor, Computer Science and Engineering University of Michigan

EECS 282 Information Systems Design and Programming. Atul Prakash Professor, Computer Science and Engineering University of Michigan EECS 282 Information Systems Design and Programming Atul Prakash Professor, Computer Science and Engineering University of Michigan 1 What is the Course About? A second programming course - but different

More information

Introduction to Programming

Introduction to Programming CHAPTER 1 Introduction to Programming Begin at the beginning, and go on till you come to the end: then stop. This method of telling a story is as good today as it was when the King of Hearts prescribed

More information

Alverton Community Primary School

Alverton Community Primary School Year 1 I can tell an adult if I see anything worrying online. I can give instructions to my friend and follow their instructions to move around. I can describe what happens when I press buttons on a robot.

More information

Lesson 1 Python: Interactive Fiction

Lesson 1 Python: Interactive Fiction Lesson 1 Python: Interactive Fiction Introduction Interactive fiction is a story told with software. We will be using the programming language Python. The program will simulate a place and some actions,

More information

Valuable points from Lesson 6 Adobe Flash CS5 Professional Classroom in a Book

Valuable points from Lesson 6 Adobe Flash CS5 Professional Classroom in a Book Valuable points from Lesson 6 Adobe Flash CS5 Professional Classroom in a Book You are expected to understand and know how to use/do each of these tasks in Flash CS5, unless otherwise noted below. If you

More information

Topics. Hardware and Software. Introduction. Main Memory. The CPU 9/21/2014. Introduction to Computers and Programming

Topics. Hardware and Software. Introduction. Main Memory. The CPU 9/21/2014. Introduction to Computers and Programming Topics C H A P T E R 1 Introduction to Computers and Programming Introduction Hardware and Software How Computers Store Data Using Python Introduction Computers can be programmed Designed to do any job

More information

HARDWARE. There are a number of factors that effect the speed of the processor. Explain how these factors affect the speed of the computer s CPU.

HARDWARE. There are a number of factors that effect the speed of the processor. Explain how these factors affect the speed of the computer s CPU. HARDWARE hardware ˈhɑːdwɛː noun [ mass noun ] the machines, wiring, and other physical components of a computer or other electronic system. select a software package that suits your requirements and buy

More information

CS 177 Recitation. Week 1 Intro to Java

CS 177 Recitation. Week 1 Intro to Java CS 177 Recitation Week 1 Intro to Java Questions? Computers Computers can do really complex stuff. How? By manipulating data according to lists of instructions. Fundamentally, this is all that a computer

More information

Senthil Kumaran S

Senthil Kumaran S Senthil Kumaran S http://www.stylesen.org/ Agenda History Basics Control Flow Functions Modules History What is Python? Python is a general purpose, object-oriented, high level, interpreted language Created

More information

9/11/08 (c) 2008 Matthew J. Rutherford Class (c) 2008 Matthew J. Rutherford Class

9/11/08 (c) 2008 Matthew J. Rutherford Class (c) 2008 Matthew J. Rutherford Class 1 2 3 4 5 6 Walter Savitch Frank M. Carrano Introduction to Computers and Java Chapter 1 ISBN 0136130887 2007 Pearson Education, Inc., Upper Saddle River, NJ. All Rights Reserved 7 Hardware and Software

More information

Functional Skills. Entry 3 to Level 2. IT Basics Information

Functional Skills. Entry 3 to Level 2. IT Basics Information Functional Skills Skills ICT Entry 3 to Level 2 YOU DO NOT NEED TO WORK THROUGH THIS. IT IS AN PACK TO TEACH YOU THE SKILLS NEEDED TO COMPLETE THE TASKS. YOU CAN USE IT WHILST WORKING THROUGH THE TASKS,

More information

Parts are adapted from Windows 98 by Mark Twain Media, Inc. A Computer System has Hardware and Software

Parts are adapted from Windows 98 by Mark Twain Media, Inc. A Computer System has Hardware and Software Parts are adapted from Windows 98 by Mark Twain Media, Inc. A Computer System has Hardware and Software All the parts--monitor, printer, hard drive, etc.-- cables, cabinets, and programs that make a computer

More information

CHAPTER 1 Introduction to Computers and Java

CHAPTER 1 Introduction to Computers and Java CHAPTER 1 Introduction to Computers and Java Copyright 2016 Pearson Education, Inc., Hoboken NJ Chapter Topics Chapter 1 discusses the following main topics: Why Program? Computer Systems: Hardware and

More information

Civil Engineering Computation

Civil Engineering Computation Civil Engineering Computation First Steps in VBA Homework Evaluation 2 1 Homework Evaluation 3 Based on this rubric, you may resubmit Homework 1 and Homework 2 (along with today s homework) by next Monday

More information

COMP1730/COMP6730 Programming for Scientists. Testing and Debugging.

COMP1730/COMP6730 Programming for Scientists. Testing and Debugging. COMP1730/COMP6730 Programming for Scientists Testing and Debugging. Overview * Testing * Debugging * Defensive Programming Overview of testing * There are many different types of testing - load testing,

More information

Introduction to Computer Programming for Non-Majors

Introduction to Computer Programming for Non-Majors Introduction to Computer Programming for Non-Majors CSC 2301, Fall 2016 Chapter 1 Instructor: Long Ma The Department of Computer Science Objectives To understand the respective roles of hardware and software

More information

Getting started 7. Saving data 23

Getting started 7. Saving data 23 Contents 1 2 3 4 Getting started 7 Programming code 8 Setting up 10 Exploring IDLE 12 Getting help 14 Saving programs 16 Storing values 18 Adding comments 20 Naming rules 21 Summary 22 Saving data 23 Storing

More information

CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch

CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch Purpose: We will take a look at programming this week using a language called Scratch. Scratch is a programming language that was developed

More information

EXPRESSIONS, STATEMENTS, AND FUNCTIONS 1

EXPRESSIONS, STATEMENTS, AND FUNCTIONS 1 EXPRESSIONS, STATEMENTS, AND FUNCTIONS 1 COMPUTER SCIENCE 61A June 24, 2014 0.1 Warmup What Would Python Do? >>> x = 6 >>> def square(x):... return x * x >>> square(x) >>> max(pow(2, 3), square(-5)) -

More information

Week 0: Intro to Computers and Programming. 1.1 Why Program? 1.2 Computer Systems: Hardware and Software. Hardware Components

Week 0: Intro to Computers and Programming. 1.1 Why Program? 1.2 Computer Systems: Hardware and Software. Hardware Components Week 0: Intro to Computers and Programming Gaddis: Sections 1.1-3 and 2.1 CS 1428 Fall 2014 Jill Seaman 1.1 Why Program? Computer programmable machine designed to follow instructions Program instructions

More information

Computer Overview. A computer item you can physically see or touch. A computer program that tells computer hardware how to operate.

Computer Overview. A computer item you can physically see or touch. A computer program that tells computer hardware how to operate. Hardware Computer Overview A computer item you can physically see or touch. Software A computer program that tells computer hardware how to operate. Information Technology (IT) The broad subject related

More information

9 th CA 2E/CA Plex Worldwide Developer Conference 1

9 th CA 2E/CA Plex Worldwide Developer Conference 1 1 Introduction/Welcome Message Organizations that are making major changes to or replatforming an application need to dedicate considerable resources ot the QA effort. In this session we will show best

More information

COMP 102: Computers and Computing

COMP 102: Computers and Computing COMP 102: Computers and Computing Lecture 5: What is Programming? Instructor: Kaleem Siddiqi (siddiqi@cim.mcgill.ca) Class web page: www.cim.mcgill.ca/~siddiqi/102.html Motivation The advantage of a computer

More information

LOOPS. Repetition using the while statement

LOOPS. Repetition using the while statement 1 LOOPS Loops are an extremely useful feature in any programming language. They allow you to direct the computer to execute certain statements more than once. In Python, there are two kinds of loops: while

More information

Introduction to Computers and Java. Objectives. Outline. Harald Gall, Prof. Dr. Institut für Informatik Universität Zürich.

Introduction to Computers and Java. Objectives. Outline. Harald Gall, Prof. Dr. Institut für Informatik Universität Zürich. Introduction to Computers and Java Harald Gall, Prof. Dr. Institut für Informatik Universität Zürich http://seal.ifi.uzh.ch 2008 W. Savitch, F.M. Carrano, Pearson Prentice Hall Objectives! Overview computer

More information

Introduction to Computers and Java

Introduction to Computers and Java Introduction to Computers and Java Harald Gall, Prof. Dr. Institut für Informatik Universität Zürich http://seal.ifi.uzh.ch 2008 W. Savitch, F.M. Carrano, Pearson Prentice Hall Objectives! Overview computer

More information

CMSC 104 -Lecture 2 John Y. Park, adapted by C Grasso

CMSC 104 -Lecture 2 John Y. Park, adapted by C Grasso CMSC 104 -Lecture 2 John Y. Park, adapted by C Grasso 1 Topics Major Computer Components Bits, Bytes, and Words The Decimal Number System The Binary Number System Converting from Binary to Decimal Converting

More information

Computer Principles and Components 1

Computer Principles and Components 1 Computer Principles and Components 1 Course Map This module provides an overview of the hardware and software environment being used throughout the course. Introduction Computer Principles and Components

More information

SI Networked Computing: Storage, Communication, and Processing, Winter 2009

SI Networked Computing: Storage, Communication, and Processing, Winter 2009 University of Michigan Deep Blue deepblue.lib.umich.edu 2009-01 SI 502 - Networked Computing: Storage, Communication, and Processing, Winter 2009 Severance, Charles Severance, C. (2008, December 19). Networked

More information

Children Aged 5-8. For. A Velsoft Computer Manual for Kids. Entertaining Activities Especially for Children...

Children Aged 5-8. For. A Velsoft Computer Manual for Kids. Entertaining Activities Especially for Children... For Children Aged 5-8 A Velsoft Computer Manual for Kids Entertaining Activities Especially for Children... Builds Learning, Use and Enjoyment of Computers Coloring Activities Learning Easy Reader The

More information

Introduction to Problem Solving and Programming in Python.

Introduction to Problem Solving and Programming in Python. Introduction to Problem Solving and Programming in Python http://cis-linux1.temple.edu/~tuf80213/courses/temple/cis1051/ Overview Types of errors Testing methods Debugging in Python 2 Errors An error in

More information

Python for Analytics. Python Fundamentals RSI Chapters 1 and 2

Python for Analytics. Python Fundamentals RSI Chapters 1 and 2 Python for Analytics Python Fundamentals RSI Chapters 1 and 2 Learning Objectives Theory: You should be able to explain... General programming terms like source code, interpreter, compiler, object code,

More information

Functional Skills. Level 2. IT Basics Learning Resource Task 1. Microsoft product screen shot(s) reprinted with permission from Microsoft Corporation.

Functional Skills. Level 2. IT Basics Learning Resource Task 1. Microsoft product screen shot(s) reprinted with permission from Microsoft Corporation. Functional Skills Skills ICT Level 2 IT Basics Learning Resource Task 1 Microsoft product screen shot(s) reprinted with permission from Microsoft Corporation. Computer basics As you work through, you will

More information

Introduction to Computers and Java

Introduction to Computers and Java Introduction to Computers and Java Harald Gall, Prof. Dr. Institut für Informatik Universität Zürich http://seal.ifi.uzh.ch 2008 W. Savitch, F.M. Carrano, Pearson Prentice Hall Objectives Overview computer

More information

Unit 4 Part A Evaluating & Purchasing a Computer. Computer Applications

Unit 4 Part A Evaluating & Purchasing a Computer. Computer Applications Unit 4 Part A Evaluating & Purchasing a Computer Computer Applications Making Informed Computer Purchasing Decisions Before Buying a Computer Speaking the language of the computer world can be tricky It

More information

CFMG Training Modules Classified Ad Strategy Module

CFMG Training Modules Classified Ad Strategy Module CFMG Training Modules Classified Ad Strategy Module In This Module: 1. Introduction 2. Preliminary Set Up Create the Sequential Letterset for our Ad Strategy Set Up Your Vanity Responder Create Your Stealth

More information

Fig 1.1 A designer working on a personal computer

Fig 1.1 A designer working on a personal computer Computer systems Computers are information processing machines. They process data to produce information. The most common mistake made by people when they talk about computers is to believe they are intelligent

More information

Administration Computers Software Algorithms Programming Languages

Administration Computers Software Algorithms Programming Languages Administration Computers Software Algorithms Programming Languages http://www.cs.sfu.ca/cc/130/johnwill/ This course does not use Canvas John Edgar 3 Come to class Read ahead Attend the labs You get practice

More information

Hello World! Computer Programming for Kids and Other Beginners. Chapter 1. by Warren Sande and Carter Sande. Copyright 2009 Manning Publications

Hello World! Computer Programming for Kids and Other Beginners. Chapter 1. by Warren Sande and Carter Sande. Copyright 2009 Manning Publications Hello World! Computer Programming for Kids and Other Beginners by Warren Sande and Carter Sande Chapter 1 Copyright 2009 Manning Publications brief contents Preface xiii Acknowledgments xix About this

More information

HANDOUT: COMPUTER PARTS

HANDOUT: COMPUTER PARTS HANDOUT: COMPUTER PARTS Because computers are so important to our lives, there is a constant need to design and develop new hardware, software, and systems. Have you used a computer before? I m sure you

More information

4.03 IT PowerPoint. Objective 4.03 Understand Information Technology activities and careers.

4.03 IT PowerPoint. Objective 4.03 Understand Information Technology activities and careers. 4.03 IT PowerPoint Objective 4.03 Understand Information Technology activities and careers. What Is A Computer? An electronic device that receives data, processes data, stores data, and produces a result

More information

Manually Install Windows Updates Xp On 7 Laptop Using Usb

Manually Install Windows Updates Xp On 7 Laptop Using Usb Manually Install Windows Updates Xp On 7 Laptop Using Usb Contents Download Links Using the WSUS Offline Update to Download all the must use the older version 9.2.1 of WSUS Offline Update for Windows XP).

More information

Information Communications Technology (CE-ICT) 6 th Class

Information Communications Technology (CE-ICT) 6 th Class Information Communications Technology (CE-ICT) 6 th Class Lecture 2: Computer Concepts (Part A) Lecturer: Objectives Hardware Concepts Types of Computer Components of a Computer System Computer Performance

More information