Learning Outcomes –Lesson 4

Slides:



Advertisements
Similar presentations
Python November 14, Unit 7. Python Hello world, in class.
Advertisements

Introduction to Python
Section 3 Calculations National 4/5 Scratch Course.
Python Programming Introduction to programming using python.
PYTHON: PART 2 Catherine and Annie. VARIABLES  That last program was a little simple. You probably want something a little more challenging.  Let’s.
Java Data Types. Primitive Data Types Java has 8 primitive data types: – char: used to store a single character eg. G – boolean: used to store true or.
Type accurately challenge! This is a starter activity and should take 2 minutes [ slide 1 ] 1.Can you type out the code in Code Box 2.1 with no errors.
Splash Screen.
Intro Python: Variables, Indexing, Numbers, Strings.
Fill the screen challenge! This is a starter activity and should take 3 minutes [ slide 1 ] 1.Log in to your computer 2.Open IDLE 3.In interactive mode,
Maths in Python [ slide 5 ] 1.Copy the table 2.Race a friend with a calculator to see whether Python is faster than a calculator: a) 5 * 6.5 = b)7 / 3.
PROGRAMMING In. Objectives  We’re learning to develop basic code with the use of the correct syntax and variables. Outcomes  Explain what syntax is.
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #001 (January 17, 2015)
Divide. Evaluate power – 3 = – 3 EXAMPLE – 3 = 3 2 – – 3 = 6 – 3 Multiply. Evaluate expressions Multiply and divide from.
Math, Data Types. Python Math Operations OperationOperator Addition + Subtraction – Multiplication * Division (floating point) / Division (integer) //
Introduction to Python Dr. José M. Reyes Álamo. 2 Three Rules of Programming Rule 1: Think before you program Rule 2: A program is a human-readable set.
NAME Python Programming Workbook Select a Lesson:
Python Lesson 1 1. Starter Create the following Excel spreadsheet and complete the calculations using formulae: 2 Add A1 and B1 A2 minus B2 A3 times B3.
PYTHON VARIABLES : CHAPTER 2 FROM THINK PYTHON HOW TO THINK LIKE A COMPUTER SCIENTIST.
COMPUTER PROGRAMMING Year 9 – Unit 9.04 Week 3. Open the Python INTERPRETER Can you use the interpreter to solve these maths problems? 156 add
Thinking about programming Intro to Computer Science CS1510 Dr. Sarah Diesburg.
Lesson 4 : Exponent Laws I Check it out... Can you see a short cut rule?
Music You buy a used guitar for $50. You then pay $10 for each of 5 guitar lessons. The total cost can be found by evaluating the expression 
Part 1 Learning Objectives To understand that variables are a temporary named location to store data and that programmers work with different data types.
Introduction to Python Lesson 2a Print and Types.
Input, Output and Variables GCSE Computer Science – Python.
Math, Data Types. Python Math Operations OperationOperator Addition + Subtraction – Multiplication * Division (floating point) / Division (integer) //
Few More Math Operators
Math operations 9/19/16.
STANDARD ALGORITHMS For Year Olds
Whatcha doin'? Aims: To start using Python. To understand loops.
A Playful Introduction to Programming by Jason R. Briggs
Python Let’s get started!.
Introduction to Python
CMSC201 Computer Science I for Majors Lecture 22 – Binary (and More)
Lecture 4: Expressions and Variables
Variables, Expressions, and IO
Design and Technology Academic Year 2017/2018 Grade 7 First Semester.
Thinking about programming
Computer Science 3 Hobart College
Lesson 3 - Repetition.
To write a Python program, you first need to open Pyscripter
Arithmetic Operators Topics Arithmetic Operators Operator Precedence
STANDARD ALGORITHMS YEARS 4-7
Lesson 1 Learning Objectives
Week 3 Computer Programming Learning Objective:
Arithmetic Operators Topics Arithmetic Operators Operator Precedence
Fill the screen challenge!
Today’s lesson – Python next steps
Escape sequences: Practice using the escape sequences on the code below to see what happens. Try this next code to help you understand the last two sequences.
Lesson Aims Vocabulary In this lesson you are going to:
Task 1 Computer Programming LEVEL 6 PROGRAMMING:
G7 programing language Teacher / Shamsa Hassan Alhassouni.
Lesson 1.1 How can you analyze data?
Divide the number in C by 10.
Operations Python code.
Lecture 4: Expressions and Variables
Beginning Python Programming
Python Math Operators.
Basic Lessons 5 & 6 Mr. Kalmes.
Introduction to Python programming for KS3
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.
Data Types and Maths Programming Guides.
Solve in Groups (Standard Write and Interpret numerical expressions )
Class code for pythonroom.com cchsp2cs
Hardware is… Software is…
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Python Creating a calculator.
PYTHON - VARIABLES AND OPERATORS
Presentation transcript:

Learning Outcomes –Lesson 4 Combine maths and text Use the Python interpreter as a calculator Explain what is meant by the term integer

Paste this table into your books

Paste the table into your book [ slide 5 ] Maths in Python Paste the table into your book Key words – write these into your book leave room to write a definition mathematical operator modulus integer float

Open the Python Shell ( Interactive mode) then open a "New window" (script mode) type in the following calculations: Save the script as "simple_calculation.py" then run it (F5) If you done things correctly you should see the answers to the calculations in the shell. Check with the image below.

Maths in Python Race a friend with a calculator to see whether Python is faster than a calculator: 5 * 6.5 = 7 / 3 = 128 + 6 = How many times does 120 divide by 7? What is the remainder of 120 / 7?

Combining Maths and Text [ slide 7 ] Combining Maths and Text The print() function will print to screen: strings, numbers or calculations separated by commas: Interactive session: What will the output from this code produce? >>> print("11 divided by 4 = ", 11//4, "remainder ", 11%4) 11 divided by 4 = 2 remainder 3 Now try entering this code: >>> print("111 divided by 4 = ", 111/4) 111 divided by 4 = 27.75 >>> print("11 divided by 4 = ", 11/4) 11 divided by 4 = 2.75 >>> print("I will not write code in history lessons.\n" *50) See what else you can produce.

Using the Python interpreter as a calculator Go back to the IDLE screen What is 156 add 567? What is 132 subtract 46? What is 256 divided by 8? What is 389 multiplied by 13? Can you work out what mathematical symbols need to be used?

What works? Both of these work

The answers – use brackets!

Why don’t these work? >>> what is 2 add 2? >>> 3 times 6 >>> 24 subtract 3 >>> How many times will 4 fit into 12?

Integers In computing, whole numbers (without decimals) are referred to as integers, this means that while 4.0 is not considered an integer, 4 is. It is possible to store integers into variables.

Integers stored into variables

Evaluating expressions

Learning Outcomes Lesson 4 Combine maths and text Use the Python interpreter as a calculator Explain what is meant by the term integer