Programming In Lesson 3.

Slides:



Advertisements
Similar presentations
PROGRAMMING In. STARTER Using the internet…Find … what does case sensitive mean what a programming language is.. 3 benefits of Python.
Advertisements

Programming in python Lesson 2.
PROGRAMMING In. STARTER Using the internet…Find …  what does “case sensitive” mean  what a programming language is..  3 benefits of Python.
Python. What is Python? A programming language we can use to communicate with the computer and solve problems We give the computer instructions that it.
PROGRAMMING In Lesson 5. RECAP  Complete the starter activity.
From Scratch to Python Learn to program like the big boys / girls!
An Introduction to Textual Programming
Python Programming Using Variables and input. Objectives We’re learning to make use of if statements to enable code to ask questions. Outcomes Build an.
Python Programming Introduction to programming using python.
By the end of this session you should be able to...
Python Programming Using Variables and input. Objectives We’re learning to build functions and to use inputs and outputs. Outcomes Build a function Use.
PROGRAMMING In Lesson 2. STARTER ACTIVITY Complete the starter activity in your python folder – lesson 2 Now we will see how you got on and update your.
Python Programming Using Variables and input. Objectives We’re learning to use basic knowledge of variables combined with user input. Outcomes Continue.
PROGRAMMING In. Objectives  We’re learning to develop basic code with the use of the correct syntax and variables. Outcomes  Explain what syntax is.
Loops and Simple Functions CS303E: Elements of Computers and Programming.
PROGRAMMING IN PYTHON LETS LEARN SOME CODE TOGETHER!
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 Lesson 2.
Loops and Simple Functions COSC Review: While Loops Typically used when the number of times the loop will execute is indefinite Typically used when.
PROGRAMMING In Lesson 6. RECAP  Discuss with the person next to you...  what you have enjoyed about python programming  What you have found difficult.
Part 1 Learning Objectives To understand that variables are a temporary named location to store data and that programmers work with different data types.
Functions. What is a Function?  We have already used a few functions. Can you give some examples?  Some functions take a comma-separated list of arguments.
Input, Output and Variables GCSE Computer Science – Python.
Programming Simple Programming Variables.
GCSE COMPUTER SCIENCE Practical Programming using Python Lesson 4 - Selection.
PYTHON PROGRAMMING Year 9. Objective and Outcome Teaching Objective Today we will look at conditional statements in order to understand how programs can.
Lesson 06: Functions Class Participation: Class Chat:
GCSE COMPUTER SCIENCE Practical Programming using Python
Whatcha doin'? Aims: To start using Python. To understand loops.
Exam #1 You will have exactly 30 Mins to complete the exam.
3.1 Fundamentals of algorithms
Topic: Python’s building blocks -> Variables, Values, and Types
Databases – Lesson 4 Key Stage 3 ICT.
Functions CIS 40 – Introduction to Programming in Python
Do it now activity Green pen activity in books.
Iterations Programming Condition Controlled Loops (WHILE Loop)
Lesson 1 Learning Objectives
Learning to Program in Python
Number Line Where are you on the learning journey?
Learning to Program in Python
Learning to Program in Python
Python I/O.
Fill the screen challenge!
Language Basics.
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.
Teaching London Computing
Lesson 06: Functions Class Chat: Attendance: Participation
Variables and Expressions
Python 21 Mr. Husch.
Functions Christopher Harrison | Content Developer
Starter answer these questions in your book
PYTHON: BUILDING BLOCKS Inputs & Outputs
PYTHON: BUILDING BLOCKS Sequencing & Selection
B065: PROGRAMMING Variables 1.
Programming In Lesson 4.
Loops and Simple Functions
Basic Lessons 5 & 6 Mr. Kalmes.
Programming In.
Input and Output Python3 Beginner #3.
Introduction to Python
Introduction to Python programming for KS3
Basic Mr. Husch.
Explain what touch develop is to your students:
Hint idea 2 Split into shorter tasks like this.
LO: To create an idea as a starting point for our devised pieces.
Algorithms For use in Unit 2 Exam.
What you need to do… Drag the pieces of code into the correct order like you can see in the EXAMPLE below. print ( “ int input ) = + Hello world chr ord.
Starter During development Plenary
Iteration – While Loops
Presentation transcript:

Programming In Lesson 3

Recap Complete the starter activity

Objectives Outcomes Understand the benefits of a function Be able to write and call a function Understand how and why we should use comments in our code Outcomes All-Level 4 To be able to write a function - with help be able to add comments to your code Most-Level 5 Be able to write a these with little help. Some-Level 6 Independently write these and adapt them and complete one of the extension tasks.

Recap - variables Write the statements that ask the user for their name and a number and display them using this line of code print(user + " your number is " + number) Hint: Use the input() function.

Recap-input Did you get something like… print("Enter your name") user=input() print ("Enter your number") number=input() print(user + " your number is " + number)

Functions In the context of programming, a function is a named sequence of statements that performs a desired operation. You have already used several functions, who can name one? input print int randint This operation is specified in a function definition. In Python, the syntax for a function definition is:

Calling a Function Functions allow us to split our coding problem into smaller chunks – which make it easier to understand They can be reused – the print function for example Allows many people to work on the same project at once Allows a project to be tested as each part is completed. Lets make our function The process for this is File , New. In this new window you will need to create a function. Demonstarte example.

Out First function Lets go through this. def main (): print ("Hello") The syntax of a function. Main is the name of the function that you call in your program. def main (): print ("Hello") main() Lets go through this. In your program – this is how you call the function called main.

Task 1 – Name function Write a Function that will ask your name, and print it out. You have 5 minutes to complete this task. Extension: Expand it by getting the user to enter a number that you will multiply by your age, add the day of the month and display it.

Answer Update your self assessment in Lesson 3 section – Task 1 – Name function.

Comments Commenting is very very very important in coding. It describes what is going on The idea is for someone who has never seen the code to be able to read it, understand it and change it It acts as a reminder, when you go back and look at your code. #

Comments - Standard Every 2 lines of code NEEDS a comment

Task 2 – Numbers function Write a program that will ask the user for four integer numbers and then add these numbers together before displaying the answer Remember I am looking for comments in your work. Demonstrate on board

Answer Update your self assessment in Lesson 3, Task 2 – Numbers function.

Plenary

Fun Time Try the fractal creating python programs. In your lesson 3 folder – under fractals.