Input and Output Python3 Beginner #3.

Slides:



Advertisements
Similar presentations
COMPUTER PROGRAMMING Task 1 LEVEL 6 PROGRAMMING: Be able to use a text based language like Python and JavaScript & correctly use procedures and functions.
Advertisements

Intro to Python Welcome to the Wonderful world of GIS programing!
Why python? Automate processes Batch programming Faster Open source Easy recognition of errors Good for data management What is python? Scripting programming.
Scripts and Flow Control. Scripts So far we have been entering commands directly into the command line But there is a better way Script files (and functions)
Instructions 1. Open xCode 2. File -> New Project 3. Start a new View based iPhone Project. The type of project you create really.
Linux & Shell Scripting Small Group Lecture 4 How to Learn to Code Workshop group/ Erin.
PYTHON: LESSON 1 Catherine and Annie. WHAT IS PYTHON ANYWAY?  Python is a programming language.  But what’s a programming language?  It’s a language.
Game Programming © Wiley Publishing All Rights Reserved. The L Line The Express Line to Learning L Line L.
Introduction to Python Dr. Bernard Chen Ph.D. University of Central Arkansas July 9 th 2012
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #001 (January 9, 2015)
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #002 (January 17, 2015)
Introduction to Engineering MATLAB – 6 Script Files - 1 Agenda Script files.
Python From the book “Think Python”
Python Programming Using Variables and input. Objectives We’re learning to build functions and to use inputs and outputs. Outcomes Build a function Use.
Lesson 4 Using Variables in Python – Creating a Simple ChatBot Program.
What does C store? >>A = [1 2 3] >>B = [1 1] >>[C,D]=meshgrid(A,B) c) a) d) b)
1 Computer Science of Graphics and Games MONT 105S, Spring 2009 Session 1 Simple Python Programs Using Print, Variables, Input.
CSC 110 Using Python [Reading: chapter 1] CSC 110 B 1.
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #001 (January 17, 2015)
OCR Computing GCSE © Hodder Education 2013 Slide 1 OCR GCSE Computing Python programming 4: Writing programs.
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.
You Need an Interpreter!. Closing the GAP Thus far, we’ve been struggling to speak to computers in “their” language, maybe its time we spoke to them in.
Sequencing The most simple type of program uses sequencing, a set of instructions carried out one after another. Start End Display “Computer” Display “Science”
Trinity College Dublin, The University of Dublin GE3M25: Computer Programming for Biologists Python Karsten Hokamp, PhD Genetics TCD, 03/11/2015.
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.
Input, Output and Variables GCSE Computer Science – Python.
PROBLEM SOLVING WARM-UP Fill in the spaces using any operation to solve the following (!, (), -/+,÷,×): = 6.
Development Environment
CST 1101 Problem Solving Using Computers
what is computer programming?
A Playful Introduction to Programming by Jason R. Briggs
Introduction to Python
Lesson 4 - Challenges.
Introduction to Python
Variables, Expressions, and IO
Lesson 3 - Repetition.
Engineering Innovation Center
Visual Basic.
Python I/O.
Python Mr. Husch.
Today’s lesson – Python next steps
Week 1 Computer Programming Year 9 – Unit 9.04
Use proper case (ie Caps for the beginnings of words)
Learning Outcomes –Lesson 4
Week 2 Computer Programming Learning Objective:
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.
Python Lessons 13 & 14 Mr. Kalmes.
Teaching London Computing
Task 1 Computer Programming LEVEL 6 PROGRAMMING:
Introduction to TouchDevelop
Python 21 Mr. Husch.
Section 1 Introduction To Programming
A look at Python Programming Language 2018.
Python programming exercise
Introduction In today’s lesson we will look at: why Python?
Scripts In Matlab.
Introduction to Python
Young Joon Kim SPL basic – Quick Start SPL First Beginner Course – 01 Young Joon Kim
Beginning Python Programming
12th Computer Science – Unit 5
Basic Lessons 5 & 6 Mr. Kalmes.
Chapter 1: Programming Basics, Python History and Program Components
Python Lessons 13 & 14 Mr. Husch.
Basic Mr. Husch.
L L Line CSE 420 Computer Games Lecture #3 Introduction to Python.
Starter Which of these inventions is: Used most by people in Britain
Programming for Business Computing Introduction
Presentation transcript:

Input and Output Python3 Beginner #3

Input and Output? input() print() Lets make output look nice!

Joining strings Python allows us to add strings together with the + symbol Create a variable called: name = “draps” Then lets format our output a little: print(“Hello, my name is “ + name) The part in quotes is a hard coded string. More dynamic code. Alternatively print(“Hello, my name is“, name)

input() function input() name = input("Please enter your name: ") input() gets a string from the user.

Python files To get the true python coding experience we need to start writing instructions into a file. .py for Python! Create a file called tut3.py in your favorite text editor, I’ll use vim. Lets add some instructions similar to the ones we wrote just before.

Running .py files On linux, from the terminal you can execute a python script in the current directory by using the command: python3 tut3.py On Windows, right click the file and open with IDLE, then hit the run tab up the top and select “Run Module”

Multiply Program Lets make something a little more useful Lets edit tut3.py We will get two numbers from the user Times them together and output the answer to the console.

Next Selection! Feel Free to leave questions in the comments I’ll try to answer all of them. Please Google your question first!