Please log on The. AN INTRODUCTION TO ‘Python is a high-level, general purpose programming language’ Python is one of the many programming languages.

Slides:



Advertisements
Similar presentations
EasyGUI “Probably the Easiest GUI in the world”. Assumptions (Teachers’ Notes) This resources sets out an introduction to using easyGUI and Python
Advertisements

CS0007: Introduction to Computer Programming Console Output, Variables, Literals, and Introduction to Type.
Introduction to C++ Programming. A Simple Program: Print a Line of Text // My First C++ Program #include int main( ) { cout
1 9/1/06CS150 Introduction to Computer Science 1 What Data Do We Have? CS 150 Introduction to Computer Science I.
Python November 14, Unit 7. Python Hello world, in class.
CS31: Introduction to Computer Science I Discussion 1A 4/2/2010 Sungwon Yang
The Class String. String Constants and Variables  There is no primitive type for strings in Java.  There is a class called String that can be used to.
Introduction to Python
CS107 Introduction to Computer Science Java Basics.
Computing Theory: BBC Basic Coding Year 11. Lesson Objective You will: Be able to define what BBC basic is Be able to annotate BBC basic code Be able.
An Introduction to Textual Programming
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #002 (January 17, 2015)
INTRODUCTION TO PYTHON. 1. The 5 operators in Python are: + - * / %
PYTHON: PART 2 Catherine and Annie. VARIABLES  That last program was a little simple. You probably want something a little more challenging.  Let’s.
Data Types Integer 15 StringHelloThere! Float/Real BooleanYes / No CharP.
Strings CS303E: Elements of Computers and Programming.
CHAPTER 7 DATA INPUT OUTPUT Prepared by: Lec. Ghader R. Kurdi.
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.
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.
Introduction to Computer Programming
Chapter 2 part #1 C++ Program Structure
Introduction to Python Lesson 1 First Program. Learning Outcomes In this lesson the student will: 1.Learn some important facts about PC’s 2.Learn how.
CSC 1010 Programming for All Lecture 3 Useful Python Elements for Designing Programs Some material based on material from Marty Stepp, Instructor, University.
Debugging, Escape Command, More Math. It’s your birthday!  Write a program that asks the user for their name and their age.  Figure out what their birth.
Variables, Input, and Output. Challenge: ● Ask the user his or her name, and repeat that name to the user ● Pause video and try.
Variables and Expressions CMSC 201. Today we start Python! Two ways to use python: You can write a program, as a series of instructions in a file, and.
Using variable Variables are used to store values.
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.
Special Methods in Java. Mathematical methods The Math library is extensive, has many methods that you can call to aid you in your programming. Math.pow(double.
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #003 (February 14, 2015)
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.
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.
Few More Math Operators
FIND THE VOLUME: 5 in 8 in 4 in.
C++ First Steps.
More about comments Review Single Line Comments The # sign is for comments. A comment is a line of text that Python won’t try to run as code. Its just.
Lesson 1 - Sequencing.
Week of 12/12/16 Test Review.
INC 161 , CPE 100 Computer Programming
Chapter 2 part #1 C++ Program Structure
Variables, Expressions, and IO
Introduction to C++ October 2, 2017.
Computational Thinking
Engineering Innovation Center
Computational Thinking
While Loops (Iteration 2)
Thinking about programming
Computer Science and an introduction to Pascal
Python I/O.
Use proper case (ie Caps for the beginnings of words)
Creation, Traversal, Insertion and Removal
Introduction to Primitive Data types
Introduction to TouchDevelop
Section 1 Introduction To Programming
Python 19 Mr. Husch.
Thinking about programming
Beginning Python Programming
Introduction to Python
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.
Input, Variables, and Mathematical Expressions
Chapter 1 c++ structure C++ Input / Output
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.
More Basics of Python Common types of data we will work with
Chapter 2 part #1 C++ Program Structure
Introduction to Primitive Data types
Presentation transcript:

Please log on The

AN INTRODUCTION TO

‘Python is a high-level, general purpose programming language’ Python is one of the many programming languages available to the public and is used daily to create anything from games to Operating Systems. Coding language is the foundations of anything you use on the computer – Python is but one of them. WHAT IS PYTHON?

Variables Strings Strings and Variables Combining Numbers and Strings WHAT WE’RE LEARNING

Variable Value

red=15 blue=10 yellow=5 print(red,blue,yellow) red=15 blue=10 yellow=blue print(red+blue+yellow)

bool=True name=‘ ………… ’ age=………… print (name + ‘ is ’ + str(age) + ‘ years old ’) EXERCISE

Strings A string is just a combination of letters in order, e.g. “The IT Crowd” A String can be declared by either single, double or triple quoting the string – e.g. ‘The IT Crowd’ “The IT Crowd” “““The IT Crowd” ” ” The you want to incorporate quotation marks into the string itself then you need to put a backslash before them e.g. ‘Nathaniel said \“Hello Everyone\”’

Combining Variables and Strings We’re going to write a question which the user can respond to question= “What did you have for lunch?” print(question) answer= input() put your answer here print(“You had ” + answer+ “ for lunch?”)

question= “What\’s your name?” print(question) answer= input() (insert name here) print=(“ You\’re called ” + answer + “ ?”)

Combining Numbers and Strings When using Python we have to tell the programme whether the value or word we’ve entered is either a string or an integer To do this we use the commands str() and int() We’re going to write a programme which asks the user for a question then adds 10 to that number print(“Give me a random number”) response=input() number=int(response) plusTen=number+10 print(“If we add 10 to your number we get ” + str(plusTen)

I want you to write a programme which asks what you had for lunch, then the price. The programme should then tell the user how much the meal would be with the addition of £1.00 Challenge

Recap What does each of these functions do? print(…..) input() len() str() int()

THANKS FOR