Week 2 Computer Programming Learning Objective:

Slides:



Advertisements
Similar presentations
Week 2 Computer Programming Gray , Calibri 24
Advertisements

COMPUTER PROGRAMMING Task 1 LEVEL 6 PROGRAMMING: Be able to use a text based language like Python and JavaScript & correctly use procedures and functions.
Learning to program using Minecraft. Learning Objective Know what Minecraft is and to explain some of it’s uses Build a simple house in creative mode.
Adding Content To Your Faculty Page 1.Login 2.Create your Faculty Page 3.
Introduction to Python
General Computer Science for Engineers CISC 106 Lecture 02 Dr. John Cavazos Computer and Information Sciences 09/03/2010.
Control Structures FOR Statement Looping.
Intro to C++. Getting Started with Microsoft Visual Studios Open Microsoft Visual Studios 2010 Click on file Click on New Project Choose Visual C++ on.
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #002 (January 17, 2015)
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
PYTHON: PART 2 Catherine and Annie. VARIABLES  That last program was a little simple. You probably want something a little more challenging.  Let’s.
Introduction to Engineering MATLAB – 6 Script Files - 1 Agenda Script files.
Lesson 4 Using Variables in Python – Creating a Simple ChatBot Program.
Lesson 6. Python 3.3 Objectives. In this lesson students will learn how to output data to the screen and request input from the user. Students will also.
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,
Variables When programming it is often necessary to store a value for use later on in the program. A variable is a label given to a location in memory.
1 Computer Science of Graphics and Games MONT 105S, Spring 2009 Session 1 Simple Python Programs Using Print, Variables, Input.
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.
Variables, Expressions and Statements
CSD 340 (Blum)1 Starting JavaScript Homage to the Homage to the Square.
Chapter Three The UNIX Editors.
Make a dice challenge! This is a starter activity and should take 5 minutes [ slide 1 ] 1.Log in to your computer 2.Open IDLE 3.Copy the code below in.
My Python Programmes NAME:.
Python Let’s get started!.
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.
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
GCSE Computing: Programming GCSE Programming Remembering Python.
For Loop GCSE Computer Science – Python. For Loop The for loop iterates over the items in a sequence, which can be a string or a list (we will discuss.
COMPUTER PROGRAMMING Year 9 – lesson 1. Objective and Outcome Teaching Objective We are going to look at how to construct a computer program. We will.
Getting Started With Python Brendan Routledge
Introducing Python 3 Introduction to Python. Introduction to Python L1 Introducing Python 3 Learning Objectives Know what Python is and some of the applications.
Part 1 Learning Objectives To understand that variables are a temporary named location to store data and that programmers work with different data types.
Input, Output and Variables GCSE Computer Science – Python.
PROBLEM SOLVING WARM-UP Fill in the spaces using any operation to solve the following (!, (), -/+,÷,×): = 6.
Input and Output Upsorn Praphamontripong CS 1110
Lesson 1 - Sequencing.
Week 4 Computer Programming Gray , Calibri 24
Python Let’s get started!.
Introduction to Python
Variables, Expressions, and IO
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Week 3 Computer Programming Learning Objective:
Learning to Program in Python
Python I/O.
Fill the screen challenge!
Today’s lesson – Python next steps
Week 5 Computer Programming Gray , Calibri 24
Week 1 Computer Programming Year 9 – Unit 9.04
Use proper case (ie Caps for the beginnings of words)
Week 5 Computer Programming Year 9 – Unit 9.04
Teaching London Computing
Task 1 Computer Programming LEVEL 6 PROGRAMMING:
Week 4 Computer Programming Year 9 – Unit 9.04
For -G7 programing language Teacher / Shamsa Hassan Alhassouni.
A look at Python Programming Language 2018.
Introduction In today’s lesson we will look at: why Python?
12th Computer Science – Unit 5
Input and Output Python3 Beginner #3.
Introduction to Python
Mu Editor – New User Cheat Sheet – CircuitPython Mode
The Python interpreter
Starter Which of these inventions is: Used most by people in Britain
File Handling.
Mu Editor – New User Cheat Sheet – CircuitPython Mode
CS 1111 Introduction to Programming Spring 2019
Hardware is… Software is…
Python Creating a calculator.
Presentation transcript:

Week 2 Computer Programming Learning Objective: Gray 80 69 69 69, Calibri 24 Dark Red RGB 153 0 0, Calibri 54 Learning Objective: To understand what =variables are To be able to use = to assign variables To be able to use the FUNCTIONS: print & input

>>> (has chevrons) Remember from last week, there are 2 modes that you can program with in PYTHON… INTERACTIVE Mode >>> (has chevrons) SCRIPT Mode Used for writing larger programs and requires F5 to run.

What is the purpose of my_name in this program? Open PYTHON and go to SCRIPT Mode (Go to FILE menu, then click New Window) Write the following code into your PYTHON window and save it as InteractiveProgram.py print("Please type your name in") my_name = input () What is the purpose of my_name in this program?

Variable Data Variable_Name Data A variable is a place in the computer’s memory that holds a temporary value. Data We can place data into a variable by ASSIGNING it to the variable. Variable_Name Data Assignment In Python, it looks like this Name = ‘Tom’

userName =input("Please type your name in") input () is a useful function that prompts the user to enter some data. It means that whatever the user types in will be ASSIGNED to the variable userName Save & Run the program (F5) to test it.

BUT! Python allows us to print a bunch of letters Edit your program and add the bottom line of code… Python allows us to print a bunch of letters (known as a string) followed by a variable! BUT! Make sure you separate the two things with a coma! Re-test the program by running it.

How does this program work? Add another question by copying and pasting lines 2 and 3 CHANGE the variable names Save it and then Run it (F5) How does this program work?

Edit your program further by adding a 3rd question Save it and then Run it (F5) print ("I am a computer...") userName = input("What is your name") print ("Hello " + name + ", nice to meet you") favouriteFood = input ("What's your favourite food?") print ("Wow, i love " + favouriteFood + ", too!") QUESTIONS … you have 2 minutes! (Teacher > Click slide to start timer) Write down the name of a variable used in the above program How many variables are used in the above program What kind of character/symbol is used to assign values to a variable Write down an example of assignment Katie is writing her first program. It won’t run properly. Can you spot the Syntax error? 0:41 0:40 0:42 0:45 0:39 0:44 0:43 0:37 0:34 0:33 0:35 0:36 0:46 0:38 0:49 0:56 0:55 0:57 0:58 1:00 0:59 0:54 0:53 0:32 0:48 0:50 0:51 0:52 0:47 0:30 0:11 0:10 0:12 0:13 0:15 0:14 0:09 0:08 0:03 End 0:04 0:05 0:07 0:06 0:16 0:17 0:26 0:25 0:27 0:28 1:01 0:29 0:24 0:23 0:19 0:18 0:20 0:21 0:22 0:31 1:02 1:41 1:40 1:42 1:43 1:45 1:44 1:39 1:38 1:34 1:03 1:35 1:36 1:37 1:46 1:47 1:56 1:55 1:57 1:58 2:00 1:59 1:54 1:53 1:49 1:48 1:50 1:51 1:52 1:32 1:33 1:12 1:11 1:13 1:14 1:31 1:15 1:10 1:09 1:05 1:04 1:06 1:07 1:08 1:17 1:16 1:27 1:26 1:28 1:29 1:30 1:18 1:25 1:24 1:19 1:21 1:20 1:22 1:23 0:01 0:02 Print(‘Hello World’)

Save as ‘Favourite_Films.py’ If you can, do all these programs in SCRIPT mode (i.e. go to FILE, NEW WINDOW…then press F5 to run) Task: Create a program in python that prompts the user for their name AND the names of their top 5 favourite films. Each film should be assigned to a separate variable. When run, the computer should output the following… Hello [my_name], your top 5 favourite films are as follows: [favourite_film1] [favourite_film2] [favourite_film3] [favourite_film4] [favourite_film5] Here is an example Hello Tim, your top 5 favourite films are as follows: The Thin Red Line City Of Angels The Breakfast Club Terminator 2 Judgement Day The Return of the King Save as ‘Favourite_Films.py’ Plenary Activity From here: http://www.computingacademy.org.uk/programming/introduction-programming-python l