Python.

Slides:



Advertisements
Similar presentations
How To Copy and Paste Pictures From the Internet
Advertisements

CSC 221: Computer Programming I Fall 2001  conditional repetition  repetition for: simulations, input verification, input sequences, …  while loops.
LECTURE 1 CMSC 201. Overview Goal: Problem solving and algorithm development. Learn to program in Python. Algorithm - a set of unambiguous and ordered.
Photocopier Business Education. Cover Document input tray Copies output position Other paper tray Paper trays.
Loops – While Loop Repetition Statements While Reading for this Lecture, L&L, 5.5.
Loops – While, Do, For Repetition Statements Introduction to Arrays
GPS Robot Navigation Critical Design Review Chris Foley, Kris Horn, Richard Neil Pittman, Michael Willis.
Cost Minimization An alternative approach to the decision of the firm
Profit Maximization Profits The objectives of the firm Fixed and variable factors Profit maximization in the short and in the long run Returns to scale.
* Note: All of the material for the Required Textbook, Optional Textbook are protected by Copyright Law. * Professor Sana Odeh’s notes and programs listed.
International Marketing Research. Intl Marketing Research Define the research problem Gather data –Secondary data sources –Primary data collection Draw.
Open & Closed Loop Systems. InputProcessOutput Input ProcessOutput Monitor Compare & Adjust To Menu Feedback Loop.
Genome Sciences 373 Genome Informatics Quiz Section 5 April 28, 2015.
Adapted from slides by Marie desJardins
Delay Attribution Guide April 2013 Changes Ana Maria Sanchez Delay Attribution Board Secretariat support.
Computer Literacy Chapter 1. IBM 360 ~1970About 2 MB (1/500 GB) memory.
Latin and Greek Elements in English Introduction to the Class Purpose of the Class –principally practical: to improve English vocabulary not by memorization.
Builtins, namespaces, functions. There are objects that are predefined in Python Python built-ins When you use something without defining it, it means.
03 October 2015 Economic Development 1 – Key terms What is development and wealth?
Python at Cypress Woods. About Cy-Woods Northwest of Houston Roughly 3,500 students Part of Cy-Fair ISD with 100,000+ students Cypress Woods High School.
These input devices of a computer. The reason why these are input is they input data to the computer. The data is input to the computer using these devices.
By the end of this session you should be able to...
Hey, Ferb, I know what we’re gonna do today! Aims: Use formatted printing. Use the “while” loop. Understand functions. Objectives: All: Understand and.
Practice with Lists and Strings CS303E: Elements of Computers and Programming.
1 CompSci 105 SS 2005 Principles of Computer Science Lecture 6: Recursion Lecturer: Santokh Singh Assignment 1 due tomorrow. Should have started working.
Lecture 15 – more on lists and for…in loops, the split() function COMPSCI 1 1 Principles of Programming.
How to Test Methods Computer Science 3 Gerb Objective: Test methods properly.
BHCSI Programming Contests. Three contests Mock Contest #1  Friday, July 16 th  2:15 – 4:45pm UCF High School Online Contest  Thursday, July 22 nd.
DIRECTIONS for Landforms Power Point Presentation (grade 3) After you are done, delete this slide –EDIT  DELETE SLIDE On the title slide, replace the.
The Geometric Distribution © Christine Crisp “Teach A Level Maths” Statistics 1.
Packages. 9/04/2005 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved L13: Layout Managers Slide 2.
1 CS 177 Week 6 Recitation Slides Review for Midterm Exam.
Mr. Weiss Section 13 – Module 71 Activity – More on Marginal Product Quantity of Labor Total Output O The following table.
Random Logic l Forum.NET l State Machine Mechanism Forum.NET 1 st Meeting ● December 27, 2005.
Section 2.2 More practice with Direct Proofs. Directions for Writing Proofs 1.Copy the statement of the theorem to be proved onto your paper. 2.Clearly.
Modules. Modules Modules are the highest level program organization unit, usually correspond to source files and serve as libraries of tools. Each file.
PYTHON FUNCTIONS. What you should already know Example: f(x) = 2 * x f(3) = 6 f(3)  using f() 3 is the x input parameter 6 is the output of f(3)
` $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200.
Structures Clauses with:  as soon as  not until Determiners:  with and without of (the)
 Python for-statements can be treated the same as for-each loops in Java Syntax: for variable in listOrstring: body statements Example) x = "string"
Files in Python Opening and Closing. Big Picture To use a file in a programming language – You have to open the file – Then you process the data in the.
Delft-FIAT.
Programming Environments
Whatcha doin'? Aims: To start using Python. To understand loops.
Module 23 Long-Run Costs and Economies of Scale
Center for Teaching and Leadership
Computer Programming Methodology Input and While Loop
2.6 Prove Statements About Segments and Angles
Engineering Innovation Center
TK1114 Computer Programming
Creating and Deleting Instances Access to Attributes and Methods
D I s , a ·.... l8l8.
Culture. When in Rome do as Romans do: challenges of cross-cultural communication.
CMSC201 Computer Science I for Majors Lecture 19 – Recursion
Loops CIS 40 – Introduction to Programming in Python
I ll I
Python 9 Mr. Husch.
Transp Course 2014 Overview.
Бази от данни и СУБД Основни понятия инж. Ангел Ст. Ангелов.
Arrays I Handling lists of data.
' 1 A ./.\.l+./.\.l
1D Arrays and Lots of Brackets
National Central University, Taiwan
CSE 1030: Aggregation and Composition
Data Types Every variable has a given data type. The most common data types are: String - Text made up of numbers, letters and characters. Integer - Whole.
Functions So far we've been using functions from the builtin module, which is automatically loaded in most cases. Occasionally we've accessed functions.
CISC101 Reminders Assignment 3 due today.
List Comprehensions Problem: given a list of prices, generate a new list that has a 20% discount to each. Formally: input: list of old prices; output:
More Basics of Python Common types of data we will work with
Hardware is… Software is…
Presentation transcript:

Python

Choose Python 3.x

Main Program and Functions def initialize(): # set board to opening configuration. return(board) def scan(board): # do the image processing and return internal board. def play(move, board): # physically move the chosen piece. def choose(intboard): # choose a move and return it. game_on = True # Main program board = initialize() while game_on: internal_board = scan(board) move = choose(internal_board) play(move, board)

The Book’s Website www.courseptr.com/downloads Copy the whole directory to some reasonable directory (like where you keep your python programs). Then you can open any module you want in IDLE. www.courseptr.com/downloads

Comparing Python to Java def average(numbers): sum = 0 for num in numbers: sum = sum + num return(sum/len(numbers)) public static double avg(int numbers[]) { double sum = 0; for (double num : numbers) sum = sum + num; } return sum/numbers.length;

Output of Vowels F**r sc*r* *nd s*v*n ***rs *g* **r f*th*rs br**ght f*rth *n th*s c*nt*n*nt, * n*w n*t**n, c*nc**v*d *n L*b*rt*, *nd d*d*c*t*d t* th* pr*p*s*t**n th*t *ll m*n *r* cr**t*d *q**l.

Output of Vowels F**r sc*r* *nd s*v*n ***rs *g* **r f*th*rs br**ght f*rth *n th*s c*nt*n*nt, * n*w n*t**n, c*nc**v*d *n L*b*rt*, *nd d*d*c*t*d t* th* pr*p*s*t**n th*t *ll m*n *r* cr**t*d *q**l. http://0.tqn.com/d/usparks/1/0/B/-/1/gettysburg6.jpg

People Are Flexible The batterys must position so that the poles are to correspond to the like poles mark on the device. This will failure or damage device if not done so correctly. http://stoeptalk.wordpress.com/2009/05/02/japlish-and-chinglese-irresistible/

People Are Flexible When passenger on foot heave in sight, tootle the horn. Trumpet him melodiously at first, but if he still obstacles your passage, then tootle him with vigor. (Brochure of a car rental firm in Tokyo - courtesy of Far Eastern Economic Review) . http://klarbooks.com/jet-program-teaching-english-japan-book/japlish-examples-funny-english.html

While Loops def whilest(): while True: st = input("$$$$$>") # then do something