Python Loops and String Manipulation
|
|
|
- Joel Wilkinson
- 10 years ago
- Views:
Transcription
1 WEEK TWO Python Loops and String Manipulation Last week, we showed you some basic Python programming and gave you some intriguing problems to solve. But it is hard to do anything really exciting until you have mastered what we are covering this week. So read on 1 Loopy Python The thing about computers is that they aren t very smart, but they are extremely fast fast at doing exactly what we tell them to do over and over (and over and over) again. Last week, we introduced the if control structure that decides whether an (indented) block of code should run or not. Any control structure that repeats a block of statements is called a loop. We call each individual repetition an iteration of the loop. Almost all programming languages provide one (or more) loop control structures. Python provides two different types, the while loop and the for loop. We ll look at while loops now and save for loops for next week! 2 while loops Let s start with a simple example: >>> i = 0 >>> while i < 3: print i i = i A while loop is basically a repetitive version of an if statement. In fact, it uses almost exactly the same syntax: it starts with the while keyword, followed by a conditional expression i < 3 and a colon. On the next line, the block is indented to indicate which statement(s) the while controls, just like if. It works like this: while the conditional expression i < 3 is, the body of the loop is run. Here, the body consists of two statements, a print statement and i = i + 1. The variable i holds the number of times the body has been executed. When the program first reaches the while statement, i has the value 0. The conditional i < 3 is this time, so print i and i = i + 1 are run. At first, the i = i + 1 line might seem confusing. How can i have the same value as i + 1? The trick is to remember this is not an equality test, but an assignment statement! So, we calculate the right hand side first (take the value of i and add 1 to it), and then we assign that back into the variable i. The i = i + 1 simply adds one to (or increments) the value of i every time we go through the loop so we know how many iterations we have completed. So after the first iteration, i holds the value 1 and we go back to the top of the loop. We then recheck the conditional expression to decide whether to run the body again. When used this way, the variable i is called a loop counter. The loop keeps executing until the value of i has been incremented to 3. When this happens, the conditional expression i < 3 now False and so we jump to the statement after the loop body (that is, the end of the program in this case). c National Computer Science School
2 3 Anatomy of a Loop There are four things to think about when writing your own loops: starting Are there any variables we need to setup before we start a loop? This is often called loop initialisation. stopping How do we know when to stop? This is called the termination condition. doing What are the instructions we want to repeat. This will become the body of the loop control structure. changing Do the instructions change in any way between each repetition. For example, we might need to keep track of how many times we have repeated the body of the loop, that is, the number of iterations. You can use these four like a checklist to make sure the loops you write are doing what you want them to. Let s look at another example: >>> i = 0 >>> while i < 7: print i i += The initialisation involves setting the loop variable to zero in i = 0. The loop will terminate when i is no longer smaller than seven i < 7. There are two statements in the body. The second one is a little different this time. Firstly, we re using a special abbreviation += for adding to an existing variable. So i += 2 is actually the same as i = i + 2. It can be used whenever you want to add something to an existing variable, and so you ll often see it for incrementing loop variables. Secondly, we re adding more than one at a time. The result is the loop will now print out all even numbers less than seven. 4 Reading multiple lines from the user So far we ve only seen examples where you know when you want to stop (e.g. before a number gets too large). However, they also work well when you don t know how many iterations you ll need in advance. For example, when you re reading multiple lines of input from the user: >>> command = raw_input( enter a command: ) >>> while command!= quit : print your command was + command command = raw_input( enter a command: ) enter a command: run your command was run enter a command: quit Here it depends on how many times it takes for the user to enter quit as the command. Rather than incrementing a loop counter, the thing that s changing involves asking the user for a new command inside the loop. 5 Common loop mistakes Loops (especially while loops) can be rather tricky to get right. Here is one mistake that is particularly common. This program is going to run for a long time: c National Computer Science School
3 i = 0 while i < 3: print i This program will run forever well until you turn your computer off, producing a continuous stream of 0 s. In fact, the only way to stop this infinite loop is to press Ctrl-C which terminates the program with an KeyboardInterrupt exception, which will look something like this: Traceback (most recent call last): File "example1.py", line 3, in -toplevelprint i KeyboardInterrupt The cause of the infinite loop is a very common mistake forgetting to increment the loop counter. Most loop mistakes involve starting, stopping or changing, so use the loop checklist to help debug your loops. 6 Getting pieces of a string Often we need to access individual characters or groups of characters in a string. Accessing a single character is done using the square bracket subscripting or indexing operation: >>> x[0] h >>> x[1] e You can also access strings from the other end using a negative index: >>> x[-1] d >>> x[-5] w A longer part of the string (called a substring) can be accessed by using an extended square bracket notation with two indices called a slice: >>> x[0:5] hello >>> len(x) 11 >>> x[6:11] world A slice starts from the first index and includes characters up to but not including the second index. So, the slice x[0:5] starts from the x[0] and goes up to x[5] (the space) but doesn t include it. There are a couple of shortcuts too: >>> x[:5] hello >>> x[6:] world c National Computer Science School
4 When the first index is zero (when taking a prefix of the sequence) the zero can be left out (like x[:5]). When the last index is the length of the string, (when taking a suffix of the sequence) the last index can be left out (like x[6:]). Negative indices work in the same way that they do for indexing. Slicing is slightly more general than indexing. The index values must fall within the length of the string, but slice indices do not have to. If the slice indices fall outside the length of the string then the empty string will be returned for all or part of the slice. Strings are also immutable, which means that once the string is constructed, it cannot be modified. For example, you cannot change a character in an existing string by assigning a new character to a subscript: >>> x[0] = X Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: str object does not support item assignment >>> You must instead create a new string by slicing up the string and concatenating the pieces, and then assigning the result back to the original variable: >>> x = X + x[1:] >>> x Xello world Every operation that looks like it is modifying a string is actually returning a new string. 7 Checking the contents of strings To check whether a string contains a particular character, all you need is the in conditional operator, like this: >>> x = hello world >>> h in x >>> z in x False The not in operator does the opposite. It returns when the string does not contain the particular character: >>> z not in x These operators also work for substrings: >>> hello in x >>> howdy not in x These conditional expressions can then be used with Python if and while loops: name = raw_input( Enter your name? ) if X in name: print Your name contains an X c National Computer Science School
5 8 Calling methods on strings Not only can you create new strings using operators like slicing (s[1:3]), addition ("hello" + "world") and multiplication ("abc"*3), but you can also call special functions on strings which create new strings with different properties. For instance, we can convert a string to lowercase or uppercase: >>> s = "I know my ABC" >>> s.lower() i know my abc >>> s.upper() I KNOW MY ABC We can also replace a particular substring with another substring: >>> s = "hello world" >>> s.replace( l, X ) hexxo worxd >>> s.replace( hello, goodbye ) goodbye world Notice that the convention for calling these string manipulation functions is different the string that we are manipulating comes first, followed by a period (or full stop), then the function name appears with any other info required in parentheses. These special functions that apply to a particular type of value are called methods. So for example, the s.replace( l, X ) is calling the replace method on the string stored in variable s. replace needs two additional pieces of information: the bit of the string to replace, in this case l and what to replace it with, in this case X. c National Computer Science School
Python Lists and Loops
WEEK THREE Python Lists and Loops You ve made it to Week 3, well done! Most programs need to keep track of a list (or collection) of things (e.g. names) at one time or another, and this week we ll show
Introduction to Python
WEEK ONE Introduction to Python Python is such a simple language to learn that we can throw away the manual and start with an example. Traditionally, the first program to write in any programming language
Exercise 1: Python Language Basics
Exercise 1: Python Language Basics In this exercise we will cover the basic principles of the Python language. All languages have a standard set of functionality including the ability to comment code,
University of Hull Department of Computer Science. Wrestling with Python Week 01 Playing with Python
Introduction Welcome to our Python sessions. University of Hull Department of Computer Science Wrestling with Python Week 01 Playing with Python Vsn. 1.0 Rob Miles 2013 Please follow the instructions carefully.
CS 1133, LAB 2: FUNCTIONS AND TESTING http://www.cs.cornell.edu/courses/cs1133/2015fa/labs/lab02.pdf
CS 1133, LAB 2: FUNCTIONS AND TESTING http://www.cs.cornell.edu/courses/cs1133/2015fa/labs/lab02.pdf First Name: Last Name: NetID: The purpose of this lab is to help you to better understand functions:
Exercise 4 Learning Python language fundamentals
Exercise 4 Learning Python language fundamentals Work with numbers Python can be used as a powerful calculator. Practicing math calculations in Python will help you not only perform these tasks, but also
We will learn the Python programming language. Why? Because it is easy to learn and many people write programs in Python so we can share.
LING115 Lecture Note Session #4 Python (1) 1. Introduction As we have seen in previous sessions, we can use Linux shell commands to do simple text processing. We now know, for example, how to count words.
Introduction to Python
Caltech/LEAD Summer 2012 Computer Science Lecture 2: July 10, 2012 Introduction to Python The Python shell Outline Python as a calculator Arithmetic expressions Operator precedence Variables and assignment
Chapter 3 Writing Simple Programs. What Is Programming? Internet. Witin the web server we set lots and lots of requests which we need to respond to
Chapter 3 Writing Simple Programs Charles Severance 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/.
Python Programming: An Introduction to Computer Science
Python Programming: An Introduction to Computer Science Sequences: Strings and Lists Python Programming, 2/e 1 Objectives To understand the string data type and how strings are represented in the computer.
CS106A, Stanford Handout #38. Strings and Chars
CS106A, Stanford Handout #38 Fall, 2004-05 Nick Parlante Strings and Chars The char type (pronounced "car") represents a single character. A char literal value can be written in the code using single quotes
Turtle Power. Introduction: Python. In this project, you ll learn how to use a turtle to draw awesome shapes and patterns. Activity Checklist
Python 1 Turtle Power All Code Clubs must be registered. By registering your club we can measure our impact, and we can continue to provide free resources that help children learn to code. You can register
Programming in Access VBA
PART I Programming in Access VBA In this part, you will learn all about how Visual Basic for Applications (VBA) works for Access 2010. A number of new VBA features have been incorporated into the 2010
Chapter 2 Writing Simple Programs
Chapter 2 Writing Simple Programs Charles Severance Textbook: Python Programming: An Introduction to Computer Science, John Zelle Software Development Process Figure out the problem - for simple problems
6.170 Tutorial 3 - Ruby Basics
6.170 Tutorial 3 - Ruby Basics Prerequisites 1. Have Ruby installed on your computer a. If you use Mac/Linux, Ruby should already be preinstalled on your machine. b. If you have a Windows Machine, you
PHP Debugging. Draft: March 19, 2013 2013 Christopher Vickery
PHP Debugging Draft: March 19, 2013 2013 Christopher Vickery Introduction Debugging is the art of locating errors in your code. There are three types of errors to deal with: 1. Syntax errors: When code
Introduction to Python for Text Analysis
Introduction to Python for Text Analysis Jennifer Pan Institute for Quantitative Social Science Harvard University (Political Science Methods Workshop, February 21 2014) *Much credit to Andy Hall and Learning
QUIZ-II QUIZ-II. Chapter 5: Control Structures II (Repetition) Objectives. Objectives (cont d.) 20/11/2015. EEE 117 Computer Programming Fall-2015 1
QUIZ-II Write a program that mimics a calculator. The program should take as input two integers and the operation to be performed. It should then output the numbers, the operator, and the result. (For
COLLEGE ALGEBRA. Paul Dawkins
COLLEGE ALGEBRA Paul Dawkins Table of Contents Preface... iii Outline... iv Preliminaries... Introduction... Integer Exponents... Rational Exponents... 9 Real Exponents...5 Radicals...6 Polynomials...5
Writing Simple Programs
Chapter 2 Writing Simple Programs Objectives To know the steps in an orderly software development process. To understand programs following the Input, Process, Output (IPO) pattern and be able to modify
Python Programming: An Introduction To Computer Science
Python Programming: An Introduction To Computer Science Chapter 8 Booleans and Control Structures Python Programming, 2/e 1 Objectives æ To understand the concept of Boolean expressions and the bool data
Python. KS3 Programming Workbook. Name. ICT Teacher Form. Do you speak Parseltongue?
Python KS3 Programming Workbook Do you speak Parseltongue? Name ICT Teacher Form Welcome to Python The python software has two windows that we will use. The main window is called the Python Shell and allows
COMSC 100 Programming Exercises, For SP15
COMSC 100 Programming Exercises, For SP15 Programming is fun! Click HERE to see why. This set of exercises is designed for you to try out programming for yourself. Who knows maybe you ll be inspired to
6. Control Structures
- 35 - Control Structures: 6. Control Structures A program is usually not limited to a linear sequence of instructions. During its process it may bifurcate, repeat code or take decisions. For that purpose,
Outline Basic concepts of Python language
Data structures: lists, tuples, sets, dictionaries Basic data types Examples: int: 12, 0, -2 float: 1.02, -2.4e2, 1.5e-3 complex: 3+4j bool: True, False string: "Test string" Conversion between types int(-2.8)
Simulation Tools. Python for MATLAB Users I. Claus Führer. Automn 2009. Claus Führer Simulation Tools Automn 2009 1 / 65
Simulation Tools Python for MATLAB Users I Claus Führer Automn 2009 Claus Führer Simulation Tools Automn 2009 1 / 65 1 Preface 2 Python vs Other Languages 3 Examples and Demo 4 Python Basics Basic Operations
Programming Languages CIS 443
Course Objectives Programming Languages CIS 443 0.1 Lexical analysis Syntax Semantics Functional programming Variable lifetime and scoping Parameter passing Object-oriented programming Continuations Exception
Chapter 15 Functional Programming Languages
Chapter 15 Functional Programming Languages Introduction - The design of the imperative languages is based directly on the von Neumann architecture Efficiency (at least at first) is the primary concern,
Python Basics. S.R. Doty. August 27, 2008. 1 Preliminaries 4 1.1 What is Python?... 4 1.2 Installation and documentation... 4
Python Basics S.R. Doty August 27, 2008 Contents 1 Preliminaries 4 1.1 What is Python?..................................... 4 1.2 Installation and documentation............................. 4 2 Getting
Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.
Name: Class: Date: Exam #1 - Prep True/False Indicate whether the statement is true or false. 1. Programming is the process of writing a computer program in a language that the computer can respond to
Base Conversion written by Cathy Saxton
Base Conversion written by Cathy Saxton 1. Base 10 In base 10, the digits, from right to left, specify the 1 s, 10 s, 100 s, 1000 s, etc. These are powers of 10 (10 x ): 10 0 = 1, 10 1 = 10, 10 2 = 100,
14:440:127 Introduction to Computers for Engineers. Notes for Lecture 06
14:440:127 Introduction to Computers for Engineers Notes for Lecture 06 Rutgers University, Spring 2010 Instructor- Blase E. Ur 1 Loop Examples 1.1 Example- Sum Primes Let s say we wanted to sum all 1,
Hypercosm. Studio. www.hypercosm.com
Hypercosm Studio www.hypercosm.com Hypercosm Studio Guide 3 Revision: November 2005 Copyright 2005 Hypercosm LLC All rights reserved. Hypercosm, OMAR, Hypercosm 3D Player, and Hypercosm Studio are trademarks
SQL Server Database Coding Standards and Guidelines
SQL Server Database Coding Standards and Guidelines http://www.sqlauthority.com Naming Tables: Stored Procs: Triggers: Indexes: Primary Keys: Foreign Keys: Defaults: Columns: General Rules: Rules: Pascal
Computer Science for San Francisco Youth
Python for Beginners Python for Beginners Lesson 0. A Short Intro Lesson 1. My First Python Program Lesson 2. Input from user Lesson 3. Variables Lesson 4. If Statements How If Statements Work Structure
A Python Tour: Just a Brief Introduction CS 303e: Elements of Computers and Programming
A Python Tour: Just a Brief Introduction CS 303e: Elements of Computers and Programming "The only way to learn a new programming language is by writing programs in it." -- B. Kernighan and D. Ritchie "Computers
Udacity cs101: Building a Search Engine. Extracting a Link
Udacity cs101: Building a Search Engine Unit 1: How to get started: your first program Extracting a Link Introducing the Web Crawler (Video: Web Crawler)... 2 Quiz (Video: First Quiz)...2 Programming (Video:
Introduction to Computer Science I Spring 2014 Mid-term exam Solutions
Introduction to Computer Science I Spring 2014 Mid-term exam Solutions 1. Question: Consider the following module of Python code... def thing_one (x): y = 0 if x == 1: y = x x = 2 if x == 2: y = -x x =
Week 2 Practical Objects and Turtles
Week 2 Practical Objects and Turtles Aims and Objectives Your aim in this practical is: to practise the creation and use of objects in Java By the end of this practical you should be able to: create objects
The first program: Little Crab
CHAPTER 2 The first program: Little Crab topics: concepts: writing code: movement, turning, reacting to the screen edges source code, method call, parameter, sequence, if-statement In the previous chapter,
Informatica e Sistemi in Tempo Reale
Informatica e Sistemi in Tempo Reale Introduction to C programming Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa October 25, 2010 G. Lipari (Scuola Superiore Sant Anna)
Moving from CS 61A Scheme to CS 61B Java
Moving from CS 61A Scheme to CS 61B Java Introduction Java is an object-oriented language. This document describes some of the differences between object-oriented programming in Scheme (which we hope you
STEP 0: OPEN UP THE PYTHON EDITOR. If python is on your computer already, it's time to get started. On Windows, find IDLE in the start menu.
01 Turtle Power Introduction: This term we're going to be learning a computer programming language called Python. The person who created Python named it after his favourite TV show: Monty Python s Flying
Object Oriented Software Design
Object Oriented Software Design Introduction to Java - II Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa October 28, 2010 G. Lipari (Scuola Superiore Sant Anna) Introduction
2 The first program: Little Crab
2 The first program: Little Crab topics: concepts: writing code: movement, turning, reacting to the screen edges source code, method call, parameter, sequence, if statement In the previous chapter, we
Chapter 13: Program Development and Programming Languages
Understanding Computers Today and Tomorrow 12 th Edition Chapter 13: Program Development and Programming Languages Learning Objectives Understand the differences between structured programming, object-oriented
Line Tracking Basic Lesson
Line Tracking Basic Lesson Now that you re familiar with a few of the key NXT sensors, let s do something a little more interesting with them. This lesson will show you how to use the Light Sensor to track
Chapter 9: Building Bigger Programs
Chapter 9: Building Bigger Programs How to Design Larger Programs Building something larger requires good software engineering. Design Top- down: Start from requirements, then identify the pieces to write,
Comparing RTOS to Infinite Loop Designs
Comparing RTOS to Infinite Loop Designs If you compare the way software is developed for a small to medium sized embedded project using a Real Time Operating System (RTOS) versus a traditional infinite
BUSINESSLINE FEATURES USER GUIDE. Do more with your business phone
BUSINESSLINE FEATURES USER GUIDE Do more with your business phone WELCOME TO TELSTRA BUSINESSLINE FEATURES Telstra BusinessLine Features are the smart way to manage your calls and stay connected to your
Welcome to Introduction to programming in Python
Welcome to Introduction to programming in Python Suffolk One, Ipswich, 4:30 to 6:00 Tuesday Jan 14, Jan 21, Jan 28, Feb 11 Welcome Fire exits Toilets Refreshments 1 Learning objectives of the course An
CSC 221: Computer Programming I. Fall 2011
CSC 221: Computer Programming I Fall 2011 Python control statements operator precedence importing modules random, math conditional execution: if, if-else, if-elif-else counter-driven repetition: for conditional
understanding sensors
The LEGO MINDSTORMS NXT 2.0 robotics kit includes three types of sensors: Ultrasonic, Touch, and Color. You can use these sensors to build a robot that makes sounds when it sees you or to build a vehicle
Introduction to Data Structures
Introduction to Data Structures Albert Gural October 28, 2011 1 Introduction When trying to convert from an algorithm to the actual code, one important aspect to consider is how to store and manipulate
Lab 2: Swat ATM (Machine (Machine))
Lab 2: Swat ATM (Machine (Machine)) Due: February 19th at 11:59pm Overview The goal of this lab is to continue your familiarization with the C++ programming with Classes, as well as preview some data structures.
mouse (or the option key on Macintosh) and move the mouse. You should see that you are able to zoom into and out of the scene.
A Ball in a Box 1 1 Overview VPython is a programming language that is easy to learn and is well suited to creating 3D interactive models of physical systems. VPython has three components that you will
VISUAL GUIDE to. RX Scripting. for Roulette Xtreme - System Designer 2.0
VISUAL GUIDE to RX Scripting for Roulette Xtreme - System Designer 2.0 UX Software - 2009 TABLE OF CONTENTS INTRODUCTION... ii What is this book about?... iii How to use this book... iii Time to start...
Problem Solving Basics and Computer Programming
Problem Solving Basics and Computer Programming A programming language independent companion to Roberge/Bauer/Smith, "Engaged Learning for Programming in C++: A Laboratory Course", Jones and Bartlett Publishers,
Object Oriented Software Design
Object Oriented Software Design Introduction to Java - II Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa September 14, 2011 G. Lipari (Scuola Superiore Sant Anna) Introduction
SPECIAL REPORT INFUSIONSOFT: 7 KEYS TO TOP RESULTS. What s Inside? OVERVIEW KEY # 1: RESPECT YOUR AUDIENCE
SPECIAL REPORT INFUSIONSOFT: 7 KEYS TO TOP RESULTS OVERVIEW You have your data imported, some follow-up sequences, and some initial results with Infusionsoft. Now what? Infusionsoft is a powerful product,
How to Make Money with Google Adwords. For Cleaning Companies. H i tm a n. Advertising
How to Make Money with Google Adwords For Cleaning Companies. H i tm a n Advertising Target Clients Profitably Google Adwords can be one of the best returns for your advertising dollar. Or, it could be
1 Stored Procedures in PL/SQL 2 PL/SQL. 2.1 Variables. 2.2 PL/SQL Program Blocks
1 Stored Procedures in PL/SQL Many modern databases support a more procedural approach to databases they allow you to write procedural code to work with data. Usually, it takes the form of SQL interweaved
qwertyuiopasdfghjklzxcvbnmqwerty uiopasdfghjklzxcvbnmqwertyuiopasd fghjklzxcvbnmqwertyuiopasdfghjklzx cvbnmqwertyuiopasdfghjklzxcvbnmq
qwertyuiopasdfghjklzxcvbnmqwerty uiopasdfghjklzxcvbnmqwertyuiopasd fghjklzxcvbnmqwertyuiopasdfghjklzx cvbnmqwertyuiopasdfghjklzxcvbnmq Introduction to Programming using Java wertyuiopasdfghjklzxcvbnmqwertyui
Perl in a nutshell. First CGI Script and Perl. Creating a Link to a Script. print Function. Parsing Data 4/27/2009. First CGI Script and Perl
First CGI Script and Perl Perl in a nutshell Prof. Rasley shebang line tells the operating system where the Perl interpreter is located necessary on UNIX comment line ignored by the Perl interpreter End
Computers. An Introduction to Programming with Python. Programming Languages. Programs and Programming. CCHSG Visit June 2014. Dr.-Ing.
Computers An Introduction to Programming with Python CCHSG Visit June 2014 Dr.-Ing. Norbert Völker Many computing devices are embedded Can you think of computers/ computing devices you may have in your
Hands-on Exercise 1: VBA Coding Basics
Hands-on Exercise 1: VBA Coding Basics This exercise introduces the basics of coding in Access VBA. The concepts you will practise in this exercise are essential for successfully completing subsequent
River Dell Regional School District. Computer Programming with Python Curriculum
River Dell Regional School District Computer Programming with Python Curriculum 2015 Mr. Patrick Fletcher Superintendent River Dell Regional Schools Ms. Lorraine Brooks Principal River Dell High School
Once the schema has been designed, it can be implemented in the RDBMS.
2. Creating a database Designing the database schema... 1 Representing Classes, Attributes and Objects... 2 Data types... 5 Additional constraints... 6 Choosing the right fields... 7 Implementing a table
Python Programming: An Introduction to Computer Science
Python Programming: An Introduction to Computer Science Chapter 7 Decision Structures Python Programming, 1/e 1 Objectives To understand the programming pattern simple decision and its implementation using
AN INTRODUCTION TO MACRO VARIABLES AND MACRO PROGRAMS Mike S. Zdeb, New York State Department of Health
AN INTRODUCTION TO MACRO VARIABLES AND MACRO PROGRAMS Mike S. Zdeb, New York State Department of Health INTRODUCTION There are a number of SAS tools that you may never have to use. Why? The main reason
Invitation to Ezhil : A Tamil Programming Language for Early Computer-Science Education 07/10/13
Invitation to Ezhil: A Tamil Programming Language for Early Computer-Science Education Abstract: Muthiah Annamalai, Ph.D. Boston, USA. Ezhil is a Tamil programming language with support for imperative
Part 1 Foundations of object orientation
OFWJ_C01.QXD 2/3/06 2:14 pm Page 1 Part 1 Foundations of object orientation OFWJ_C01.QXD 2/3/06 2:14 pm Page 2 1 OFWJ_C01.QXD 2/3/06 2:14 pm Page 3 CHAPTER 1 Objects and classes Main concepts discussed
Introduction to Python
Introduction to Python Sophia Bethany Coban Problem Solving By Computer March 26, 2014 Introduction to Python Python is a general-purpose, high-level programming language. It offers readable codes, and
Limitation of Liability
Limitation of Liability Information in this document is subject to change without notice. THE TRADING SIGNALS, INDICATORS, SHOWME STUDIES, PAINTBAR STUDIES, PROBABILITYMAP STUDIES, ACTIVITYBAR STUDIES,
UGBA 103 (Parlour, Spring 2015), Section 1. Raymond C. W. Leung
UGBA 103 (Parlour, Spring 2015), Section 1 Present Value, Compounding and Discounting Raymond C. W. Leung University of California, Berkeley Haas School of Business, Department of Finance Email: [email protected]
Chapter 2. Making Shapes
Chapter 2. Making Shapes Let's play turtle! You can use your Pencil Turtle, you can use yourself, or you can use some of your friends. In fact, why not try all three? Rabbit Trail 4. Body Geometry Can
Selecting Features by Attributes in ArcGIS Using the Query Builder
Helping Organizations Succeed with GIS www.junipergis.com Bend, OR 97702 Ph: 541-389-6225 Fax: 541-389-6263 Selecting Features by Attributes in ArcGIS Using the Query Builder ESRI provides an easy to use
Subnetting Examples. There are three types of subnetting examples I will show in this document:
Subnetting Examples There are three types of subnetting examples I will show in this document: 1) Subnetting when given a required number of networks 2) Subnetting when given a required number of clients
How to Create a Campaign in AdWords Editor
How to Create a Campaign in AdWords Editor Using AdWords Editor instead of the online interface for Google Adwords will speed up everything in your online business. AdWords Editor gives you the upper hand
VLOOKUP Functions How do I?
For Adviser use only (Not to be relied on by anyone else) Once you ve produced your ISA subscription report and client listings report you then use the VLOOKUP to create all the information you need into
Visual Basic Programming. An Introduction
Visual Basic Programming An Introduction Why Visual Basic? Programming for the Windows User Interface is extremely complicated. Other Graphical User Interfaces (GUI) are no better. Visual Basic provides
Section 1.5 Exponents, Square Roots, and the Order of Operations
Section 1.5 Exponents, Square Roots, and the Order of Operations Objectives In this section, you will learn to: To successfully complete this section, you need to understand: Identify perfect squares.
Objectives. Python Programming: An Introduction to Computer Science. Lab 01. What we ll learn in this class
Python Programming: An Introduction to Computer Science Chapter 1 Computers and Programs Objectives Introduction to the class Why we program and what that means Introduction to the Python programming language
Formal Languages and Automata Theory - Regular Expressions and Finite Automata -
Formal Languages and Automata Theory - Regular Expressions and Finite Automata - Samarjit Chakraborty Computer Engineering and Networks Laboratory Swiss Federal Institute of Technology (ETH) Zürich March
Gas Dynamics Prof. T. M. Muruganandam Department of Aerospace Engineering Indian Institute of Technology, Madras. Module No - 12 Lecture No - 25
(Refer Slide Time: 00:22) Gas Dynamics Prof. T. M. Muruganandam Department of Aerospace Engineering Indian Institute of Technology, Madras Module No - 12 Lecture No - 25 Prandtl-Meyer Function, Numerical
CSE 1223: Introduction to Computer Programming in Java Chapter 2 Java Fundamentals
CSE 1223: Introduction to Computer Programming in Java Chapter 2 Java Fundamentals 1 Recall From Last Time: Java Program import java.util.scanner; public class EggBasket { public static void main(string[]
Concepts in IP Addressing...
3 Concepts in IP Addressing Terms You ll Need to Understand: Binary Hexadecimal Decimal Octet IP address Subnet Mask Subnet Host Increment Techniques You ll Need to Master: Identifying Address Class and
LEARNING TO PROGRAM WITH PYTHON. Richard L. Halterman
LEARNING TO PROGRAM WITH PYTHON Richard L. Halterman Copyright 2011 Richard L. Halterman. All rights reserved. i Contents 1 The Context of Software Development 1 1.1 Software............................................
Some Scanner Class Methods
Keyboard Input Scanner, Documentation, Style Java 5.0 has reasonable facilities for handling keyboard input. These facilities are provided by the Scanner class in the java.util package. A package is a
PROBLEM SOLVING SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON
PROBLEM SOLVING WITH SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON Addison Wesley Boston San Francisco New York London
Intro to scientific programming (with Python) Pietro Berkes, Brandeis University
Intro to scientific programming (with Python) Pietro Berkes, Brandeis University Next 4 lessons: Outline Scientific programming: best practices Classical learning (Hoepfield network) Probabilistic learning
Beginning to Program Python
COMP1021 Introduction to Computer Science Beginning to Program Python David Rossiter Outcomes After completing this presentation, you are expected to be able to: 1. Use Python code to do simple text input
The Basics of Robot Mazes Teacher Notes
The Basics of Robot Mazes Teacher Notes Why do robots solve Mazes? A maze is a simple environment with simple rules. Solving it is a task that beginners can do successfully while learning the essentials
PL/SQL Overview. Basic Structure and Syntax of PL/SQL
PL/SQL Overview PL/SQL is Procedural Language extension to SQL. It is loosely based on Ada (a variant of Pascal developed for the US Dept of Defense). PL/SQL was first released in ١٩٩٢ as an optional extension
MEDIABURST: SMS GUIDE 1. SMS Guide
MEDIABURST: SMS GUIDE 1 SMS Guide MEDIABURST: SMS GUIDE 2 Contents Introduction 3 This guide will cover 3 Why use SMS in business? 4 Our products 5 How do I add existing contacts? 6 Who are you sending
JavaScript: Control Statements I
1 7 JavaScript: Control Statements I 7.1 Introduction 2 The techniques you will learn here are applicable to most high-level languages, including JavaScript 1 7.2 Algorithms 3 Any computable problem can
Python Tutorial. Release 2.6.4. Guido van Rossum Fred L. Drake, Jr., editor. January 04, 2010. Python Software Foundation Email: docs@python.
Python Tutorial Release 2.6.4 Guido van Rossum Fred L. Drake, Jr., editor January 04, 2010 Python Software Foundation Email: [email protected] CONTENTS 1 Whetting Your Appetite 3 2 Using the Python Interpreter
Advanced Programming with LEGO NXT MindStorms
Advanced Programming with LEGO NXT MindStorms Presented by Tom Bickford Executive Director Maine Robotics Advanced topics in MindStorms Loops Switches Nested Loops and Switches Data Wires Program view
