The backslash is used to escape characters that are used in Python

Slides:



Advertisements
Similar presentations
Introduction to C++ Programming. A Simple Program: Print a Line of Text // My First C++ Program #include int main( ) { cout
Advertisements

x y First we look at how far up the point is, this is on the vertical Y axis. HORIZONTAL VERTICALVERTICAL.
There are two ways of reporting what somebody says;  direct speech  indirect (or reported) speech. Reporting speech.
 2002 Prentice Hall. All rights reserved. 1 Intro: Java/Python Differences JavaPython Compiled: javac MyClass.java java MyClass Interpreted: python MyProgram.py.
Chapter 9 Formatted Input/Output Acknowledgment The notes are adapted from those provided by Deitel & Associates, Inc. and Pearson Education Inc.
1 Character Strings and Variables Character Strings Variables, Initialization, and Assignment Reading for this class: L&L,
Chapter 3: Introduction to C Programming Language C development environment A simple program example Characters and tokens Structure of a C program –comment.
2.2 Information on Program Appearance and Printing.
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #002 (January 17, 2015)
Introduction to Java Thanks to Dan Lunney (SHS). Java Basics File names The “main” method Output to screen Escape Sequence – Special Characters format()
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.
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #005 (April somthin, 2015)
CHAPTER 2 PART #1 C++ PROGRAM STRUCTURE 1 st semester H 1 King Saud University College of Applied studies and Community Service Csc 1101 By:
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.
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.
PHYS 2020 Basic C An introduction to writing simple but useful programs in C In these lectures I will take you through the basics of C, but you will need.
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.
Please log on The. AN INTRODUCTION TO ‘Python is a high-level, general purpose programming language’ Python is one of the many programming languages.
Introduction to Computer Programming
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #001 (January 17, 2015)
Computing Science 1P Large Group Tutorial: Lab Exam & Class Test Simon Gay Department of Computing Science University of Glasgow 2006/07.
Chapter 2 part #1 C++ Program Structure
Files in Python Output techniques. Outputting to a file There are two ways to do this in Python – print (more familiar, more flexible) – write (more restrictive)
Printing in Python. Printing Every program needs to do some output This is usually to the screen (shell window) Later we’ll see graphics windows and external.
1 Data and Expressions Chapter 2 In PowerPoint, click on the speaker icon then the “play” button to hear audio narration.
Interpolation Variable Interpolation, Backslash Interpolation.
© 2007 Lawrenceville Press Slide 1 Chapter 3 Classes and Objects 1. How is a class different from an object?
Introducing Java Chapter 3 Review. Why Program in Java? Java, is an object-oriented programming language. OOP languages evolved out of the need to better.
Chapter 2 1.What is the difference between print / println 2.What are String Literals 3.What are the Escape Characters for backslash, double quotataions,
Escape sequence Certain characters, preceded by a backslash ( \ ), are known as escape sequences They are used to display certain characters, or as display.
Course A201: Introduction to Programming 09/09/2010.
Python: File Directories What is a directory? A hierarchical file system that contains folders and files. Directory (root folder) Sub-directory (folder.
Getting Started With Python Brendan Routledge
OCR Computing GCSE © Hodder Education 2013 Slide 1 OCR GCSE Computing Python programming 10: Files.
Chapter 4 Strings and Screen I/O. Objectives Define strings and literals. Explain classes and objects. Use the string class to store strings. Perform.
Print the sample banner slides or customize with your own message. Click on the letter and type your own text. Use one character per slide. C.
GCSE COMPUTER SCIENCE Practical Programming using Python
28 Formatted Output.
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.
what is computer programming?
Topic Pre-processor cout To output a message.
CHAPTER 2 PART #1 C++ PROGRAM STRUCTURE
Creates the file on disk and opens it for writing
Variables and Expressions
Chapter 2, Part I Introduction to C Programming
Chapter 2 part #1 C++ Program Structure
Direct and Indirect Speech.
In Class Program: Today in History
Direct and Indirect Speech.
Chapter 3 Classes and Objects
Learning Outcomes –Lesson 4
Winter 2018 CISC101 12/1/2018 CISC101 Reminders
Creates the file on disk and opens it for writing
Tell me What’s Wrong with these Slides?
Tell me what’s wrong with these Slides?
Task 1 Computer Programming LEVEL 6 PROGRAMMING:
Spot the bug!.
Chapter 2 Create a Chapter 2 Workspace Create a Project called Notes
Lists in Python Outputting lists.
Inputs and Variables Programming Guides.
Beginning Python Programming
Output Manipulation.
Python Lessons 7 & 8 Mr. Kalmes.
Python Lessons 7 & 8 Mr. Husch.
Co-ordinates.
Direct and Indirect Speech.
Python 8 Mr. Husch.
Chapter 2 part #1 C++ Program Structure
Recap from year 8: How many different factorised forms can you find?
Programming Techniques
Presentation transcript:

The backslash is used to escape characters that are used in Python The backslash is used to escape characters that are used in Python. When you want to print to the screen you need to wrap it in speech marks. But if you actually want to type in some speech marks you will need to put a backslash before it. What do you need to do if you want to print a backslash to the screen ?

Recap Functions:- Print () is a function it will print anything inside the brackets. They must be separated by a comma, and strings (bits of text) must be put in speech marks. Everything in the speech marks will be printed in order.

Functions (more in chapter 4) [ slide 6 ] Functions (more in chapter 4) Output from the print function appears in blue text. print() is a function. We can put a variety of things inside the brackets to be printed to the screen . So far we have supplied bits of text but it can do much more ... Coders call text, strings.