Compsci 06/101, Fall 2010 2.1 Vocabulary l What's the Spanish word for 'boy'? 'eat'?  How do you know? l What about the Turkish equivalents?  How do.

Slides:



Advertisements
Similar presentations
Python Basics: Statements Expressions Loops Strings Functions.
Advertisements

CS 100: Roadmap to Computing Fall 2014 Lecture 0.
CompSci 101 Introduction to Computer Science February 3, 2015 Prof. Rodger Lecture given by Elizabeth Dowd.
PHYS 2020 Pseudocode. Real Programmers Program in Pencil!  You can save a lot of time if you approach programming in a methodical way.  1) Write a clear.
16-Jun-15 Recursion. 2 Definitions I A recursive definition is a definition in which the thing being defined occurs as part of its own definition Example:
16/27/ :53 PM6/27/ :53 PM6/27/ :53 PMLogic Control Structures Arithmetic Expressions Used to do arithmetic. Operations consist of +,
Genome Revolution: COMPSCI 004G 3.1 What is a program? What is code? l Instructions in a language a computer executes  Languages have different characteristics,
CompSci 100 Prog Design and Analysis II Sept 7, 2010 Prof. Rodger 1CompSci 100 Fall 2010.
General Computer Science for Engineers CISC 106 Lecture 02 Dr. John Cavazos Computer and Information Sciences 09/03/2010.
Invitation to Computer Science, Java Version, Second Edition.
Compsci 101, Fall Plan for the week: Week 2, Sept 1-5 l Understanding program structure  Defining, testing, calling functions  How to run a.
Compsci 06/101, Fall Compsci 6/101: Sept 6-10 l We've looked at the language Python  Names and types: int, float, long, String, file, …  Operations:
Introduction. 2COMPSCI Computer Science Fundamentals.
Compsci 101.2, Fall PFTT (plan for this Thursday) l What is a Python program?  In the context of what we do in Compsci 101  In a neuroscience.
Compsci 06/101, Fall What will we do today? l Practice solving problems  Solving problems without a computer  Is this different than solving.
Compsci 101.2, Fall Plan For the Week l Solve problems by programming in Python  Like to do "real-world" problems, but we're very new to the.
Compsci 101.2, Fall PFThursday l Review Organization and Problem-Solving  Defining functions, calling functions  Return types, print, None l.
Compsci 100, Fall Data and Information How and why do we organize data? Differences between data and information? What about knowledge?
Compsci 06/101, Fall What will you do in Compsci 6 Today? l Learn about selection and if/else statements  In context of solving problems  Understanding.
National Diploma Unit 4 Introduction to Software Development Introduction to Programming Languages.
Functions, Procedures, and Abstraction Dr. José M. Reyes Álamo.
Built-in Data Structures in Python An Introduction.
How to Read Code Benfeard Williams 6/11/2015 Susie’s lecture notes are in the presenter’s notes, below the slides Disclaimer: Susie may have made errors.
Compsci 6/101, Spring More on Python, Tools, Compsci 101 l APTs, Assignments, Tools  APT: Algorithmic Problem-solving and Testing  How to get.
ICAPRG301A Week 2 Strings and things Charles Babbage Developed the design for the first computer which he called a difference engine, though.
History of Computing. Where did it start? Abucus 500 B.C. The abacus was first used by the Babylonians as an aid to simple arithmetic at sometime around.
A Computer Science Tapestry 2.1 Writing and Understanding C++ l Writing programs in any language requires understanding the syntax and semantics of the.
Genome Revolution: COMPSCI 004G 2.1 Bioinformatics Vocabulary l Processing, analyzing, experimenting with data  Where does the data come from?  How do.
A Computer Science Tapestry 2.1 Writing and Understanding C++ l There are language independent skills in programming (C++, Java, …) l However, writing.
Compsci 101.2, Fall PFTWeek l Introduce new Python concepts  Control: if, elif, else, for  Data: Strings, Lists Operators on data: slicing,
I Power Higher Computing Software Development High Level Language Constructs.
CS 1 with Robots Variables, Data Types & Math Institute for Personal Robots in Education (IPRE)‏ Sec 9-7 Web Design.
CPS 100, Spring Data and Information How and why do we organize data? Differences between data and information? What about knowledge?
Compsci 101.2, Fall Plan for FWON l Review current assignments and APTs  Review Dictionaries and how to use them  Code and APT walk-through.
Compsci 101, Fall Plan For The Day (PFTD) l Practice solving problems  Some solved with a computer, some with Python  Differences in solving.
Compsci 101.2, Fall Plan for October 22 l Images, tuples, RGB color model  Image processing by understanding API  Image processing with tuples.
CPS APTs and structuring data/information l Is an element in an array, Where is an element in an array?  DIY: use a loop  Use Collections, several.
Compsci 101.2, Fall Plan for WEFWOO l Review for exam, studying and practicing for exams and APTs in Compsci 101  Why memorization doesn't help.
Compsci 6/101, Spring PFTW: Functions, Control, Python/Tools l How do functions work and why do we use them?  Functions we call (APIs), Functions.
Compsci 06/101, Spring Compsci 6: PFTW l Problem solving and (Python) programming  What are the steps in solving an APT?  How do you get better.
CompSci 101 Introduction to Computer Science January 26, 2016 Prof. Rodger compsci 101, spring
CPS What's in Compsci 100? l Understanding tradeoffs: reasoning, analyzing, describing…  Algorithms  Data Structures  Programming  Design l.
CompSci 101 Introduction to Computer Science January 15, 2015 Prof. Rodger 1.
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #003 (February 14, 2015)
小型系統 心情 vs. 古典樂 心情 vs. 古典樂 浪漫求籤系統 美食導航系統 季潔亭雅鈺熒岱芸 美食導航系統 楊氏音樂模擬大會考人瑋 若維 芷萱 伽倩 楊氏音樂模擬大會考 麥當勞熱量計算系統 火星文困擾你嗎 ? 火星文困擾你嗎 ? 歌詞知多少 - 挑戰你的腦容量英琪 日馨 青雪 鈺娟.
Quiz 1 A sample quiz 1 is linked to the grading page on the course web site. Everything up to and including this Friday’s lecture except that conditionals.
History. Development Driven by Function Functions of a Programming Language –To describe computation for use by computers –To describe computation and.
CompSci 101 Introduction to Computer Science
Data and Information How and why do we organize data? Differences between data and information? What about knowledge?
CS 1428 Exam I Review.
Presented By S.Yamuna AP/IT
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
What Is a Program? A program is like an algorithm, but describes a process that is ready or can be made ready to run on a real computer Retrieved from:
Functions, Procedures, and Abstraction
CompSci 101 Introduction to Computer Science
Variables, Data Types & Math
Compsci 6/101: PFTW Review how APTs and Python work, run
ECS15 boolean.
Variables, Data Types & Math
Chapter 2 – part a Brent M. Dingle Texas A&M University
Introduction to Strings
General Computer Science for Engineers CISC 106 Lecture 03
CMPT 120 Lecture 3 - Introduction to Computing Science – Programming language, Variables, Strings, Lists and Modules.
CS 100: Roadmap to Computing
CS 1428 Exam I Review.
Functions, Procedures, and Abstraction
Writing and Understanding C++
Presentation transcript:

Compsci 06/101, Fall Vocabulary l What's the Spanish word for 'boy'? 'eat'?  How do you know? l What about the Turkish equivalents?  How do you know? l How do you learn vocabulary of Python?  Words  Sentences  Paragraphs  Essays

Compsci 06/101, Fall What will we do today? l Practice solving problems  Solving problems without a computer  Solving problems with a computer  Difference? l Practice using tools for Duke Compsci courses  Eclipse, APT, ambient  Blackboard, Bulletin board, Feedback l Reveling in the wonder of thinking and working  How do we know when something works?

Compsci 06/101, Fall What else will we do today? l Naming  The power of abstraction and parameterization  What is abstraction?  What are parameters? What has them? l Types  What have we seen? What's used in computing?  Determine names of types in Python l Expressions and operators in Python  Arithmetic: +, -, *, /, %, **, …  Boolean:, and,...  String: +, *, [], [:], [::]

Compsci 06/101, Fall Ada Lovelace, l Daughter of Byron, advocate of work of Charles Babbage, creator of "Analytical Engine"  Made Babbage’s work accessible “ It would weave algebraic patterns the way the Jacquard loom weaved patterns in textiles ” l Tutored in mathematics by Augustus de Morgan l Marched around the billiard table playing the violin l Ada is a notable programming language

Compsci 06/101, Fall Counting words in a file redux file = open('/data/poe.txt') str = file.read() words = str.split() print "# words in",name, "=",len(words) l What are the names in the code above?  Why are names important? l What are the types in the code above?  How do we get Python to help us answer this question l How do we re-use this code more generally  The power of names!

Compsci 06/101, Fall Interlude l Use word-counting code in Eclipse  Python console, type and see  Using names, what a.py file, and functions provide  Toward Python types, operators, expressions l Python functions and expressions  Pounds2Stone  BMI BMI  Heron's formula Heron's formula  …

Compsci 06/101, Fall David Parnas "For much of my life, I have been a software voyeur, peeking furtively at other people's dirty code. Occasionally, I find a real jewel, a well-structured program written in a consistent style, free of kludges, developed so that each component is simple and organized, and designed so that the product is easy to change. "

Compsci 06/101, Fall Parnas on re-invention "We must not forget that the wheel is reinvented so often because it is a very good idea; I've learned to worry more about the soundness of ideas that were invented only once. "

Compsci 06/101, Fall David Parnas (entry in Wikipedia)Wikipedia l Module Design: Parnas wrote about the criteria for designing modules, in other words, the criteria for grouping functions together. This was a key predecessor to designing objects, and today's object-oriented design. l Social Responsibility: Parnas also took a key stand against the Strategic Defense Initiative (SDI) in the mid 1980s, arguing that it would be impossible to write an application that was free enough from errors to be safely deployed.Strategic Defense Initiative l Professionalism: He believes that software engineering is a branch of traditional engineering.

Compsci 06/101, Fall String operator interlude l Concatenation, what can be added to a string?  How do we find this out using Python?  How are types related to this question? l Slicing and Indexing  How do we get parts of a String?  What are the parts of a String?  [] and [:], l What does immutable mean? Hello to Jello?  What is a variable in Python?

Compsci 06/101, Fall Expressions, Operators, Names Why is 3+5*4 different than (3+5)*4 ?  Where can you find information about precedence? Why is 5/3 different than 5.0/3 ?  What will happen in Python 3? Accommodate in 2.6? l What happens when operators go bad?  What is "apple" + 3? What is "apple" + "pi"? l What is a variable in Python?  Does it have a name? Does it have a type?

Compsci 06/101, Fall Functions and Modules in Python l Naming related statements: function  What does naming provide? Reuse and modifiability l Naming related functions: module  Collection of functions that can be re-used/imported l Functions can return values and have parameters  Power of parameters  Power of return values l What about printing?