Displaying text print Susan Ibach | Technical Evangelist

Slides:



Advertisements
Similar presentations
Macintosh OS X. What is an operating system? O Like cars, computers have operating systems (sometimes abbreviated OS). O A computer operating system is.
Advertisements

Introduction to C++ Programming. A Simple Program: Print a Line of Text // My First C++ Program #include int main( ) { cout
Follow the Leader Drawing Tool Practice Exercises.
Chapter 4: Looping CSCI-UA 0002 – Introduction to Computer Programming Mr. Joel Kemp.
Introduction to Computational Linguistics Programming I.
Working with the VB IDE. Running a Program u Clicking the”start” tool begins the program u The “break” tool pauses a program in mid-execution u The “end”
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.
Today’s Announcements Assignment 8 is due Project 2 is due 7/27/04 We will be skipping chapter 22 Test 3 (chapters 18-21) will be on 7/29/04 Tip of the.
Multiplication Level 3 (facts 0 - 9) Read These Instructions:  Try to get the answer before the computer puts it on the screen.  Do not click on your.
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.
How to Back Up In 10 Easy Steps. Step 1: Double click on My computer. You should see something like this. WatchWatch.
PROGRAMMING IN PYTHON LETS LEARN SOME CODE TOGETHER!
Multiplication Level 1 (Facts 0-2) Read These Instructions:  Try to get the answer before the computer puts it on the screen.  Do not click on your.
Multiplication Level 2 (facts 0-2, 5, 9) Read These Instructions:  Try to get the answer before the computer puts it on the screen.  Do not click on.
Loops (While and For) CSE 1310 – Introduction to Computers and Programming 1.
Multiplication Level Read These instructions:  Try to get the answer before the computer puts it on the screen.  Do not click on your mouse,
Click Here to Start Central Fire Command Welcome. I am glad that you have accepted the challenge of becoming a fire rescue professional. We are going.
1 Module 1 Computer Basics A Module of the CYC Course Computer Basics.
Sage Franch | Technical Evangelist Susan Ibach | Technical Evangelist.
Learning to use a ‘For Loop’ and a ‘Variable’. Learning Objective To use a ‘For’ loop to build shapes within your program Use a variable to detect input.
Introduction to Programming using Python
Numbers and arithmetic
Appendix A Introduction to Windows 7
CST 1101 Problem Solving Using Computers
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.
A-level Computing Programming challenge 1: Fizzbuzz
what is computer programming?
Numbers and Arithmetic
Introduction to Programming
PowerPoint® by Mr. Brown – Info Source:
GCSE COMPUTER SCIENCE Practical Programming using Python
FLOWCHARTS Part 1.
GCSE COMPUTER SCIENCE Practical Programming using Python
Lesson 1 An Introduction
3.01 Apply Controls Associated With Visual Studio Form
Design & Technology Grade 7 Python
3.01 Apply Controls Associated With Visual Studio Form
Functions CIS 40 – Introduction to Programming in Python
Chapter 1 - An Introduction to Computers and Problem Solving
Handling errors try except
Topics Introduction to Repetition Structures
How can we format the HP Laptop. The method to reformat a HP Laptop appears to be very complicated for the users who do not have a satisfactory understanding.
Introduction to Microsoft Windows
Lesson 1 Learning Objectives
Imperative Programming
Week 1 Computer Programming Year 9 – Unit 9.04
Introduction to Programming with Python
Introduction to Programming with Python
Manipulating Text In today’s lesson we will look at:
Introduction to Programming using Python
Coding Concepts (Basics)
Task 1 Computer Programming LEVEL 6 PROGRAMMING:
Remembering lists of values lists
Lists in Python Outputting lists.
Exploring the Basics of Microsoft Windows 7
Functions Christopher Harrison | Content Developer
How to save information in files open, write, close
Python programming exercise
Beginning Python Programming
POWER CHALLENGES Several Ways To Solve 7 CHALLENGES.
Making decisions with code
Introduction to Python
Python Inputs Mr. Husch.
Starter Which of these inventions is: Used most by people in Britain
Imperative Programming
Human-computer interaction
How to read from a file read, readline, reader
Data Types and Expressions
Getting Started with PowerShell Jump Start
Working with dates and times
Presentation transcript:

Displaying text print Susan Ibach | Technical Evangelist Christopher Harrison | Content Developer

Have you ever used a computer to Read a book? Read a movie review? Read instructions on how to clean crayon off your walls? Learn all about the capybara?

Many computer programs provide information One of the simplest but important things you need the ability to do in your code is display text

The print statement is used to display text print('Hickory Dickory Dock! The mouse ran up the clock') print("Hickory Dickory Dock! The mouse ran up the clock") You can use single quotes or double quotes

Printing text

Multiple lines

Does it matter if you use single or double quotes? print("It's a beautiful day in the neighborhood") print('It's a beautiful day in the neighborhood') Only if the string you are displaying contains a single or double quote. It’s a good habit to pick one and stick with it as much as possible.

What if I want my text to appear on multiple lines? You can use multiple print statements print('Hickory Dickory Dock!') print('The mouse ran up the clock')

You can also use “\n” to force a new line print('Hickory Dickory Dock!\nThe mouse ran up the clock')

Here’s a neat Python trick: triple quotes! print("""Hickory Dickory Dock! The mouse ran up the clock""") print('''Hickory Dickory Dock! The mouse ran up the clock''') When you put the string in triple quotes, it will be displayed the way you have the string in the text editor

Line Management

Same problem, multiple solutions

Which do you think is better? print('Hickory Dickory Dock!') print('The mouse ran up the clock') print('Hickory Dickory Dock!\nThe mouse ran up the clock') print('''Hickory Dickory Dock! The mouse ran up the clock''')

Geek Tips There is often more than one way to solve the same problem Sometimes it really doesn’t matter which way you do it, as long as it works!

Multiple options, same output

When good code goes bad...

There is another important programming concept you need to learn as well It’s okay to make mistakes in your code All programmers make typing mistakes and coding mistakes

So it might be useful to practice finding our mistakes print(Hickory Dickory Dock) print('It's a small world') print("Hi there') prnit("Hello World!") print('Hickory Dickory Dock') print("It's a small world") print("Hi there") print("Hello World!")

Your challenge should you choose to accept it Write a program that will display the following poem on the screen There once was a movie star icon who preferred to sleep with the light on. They learned how to code a device that sure glowed and lit up the night using Python!

Congratulations! You can now write a computer program that will share information with a user