00 slide presentation[1] - Engineering Computation:...

Info iconThis preview shows pages 1–15. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Engineering Computation: Tutorial 00 Problem Solving with Computing, using the Python Language Todays Topics: 1 Course resources 2 Downloading and installing Python 3 Printing things to the screen 4 Using Python as a calculator 5 Integer division 2 Hello World Textbook For resources specifically related to the text, such as: source code for all the example programs supplementary materials The text site is at http://mcsp.wartburg.edu/zelle/python/ 3 Python For all things Pythonic http://www.python.org Browse documentation. Get pointers to lots of Python-related applications and projects. 4 IDLE When you download Python from the site, you are downloading an IDE. An IDE is an Integrated development environment . The name of Pythons IDE is IDLE. 5 IDLE When you download Python from the site, you are downloading an IDE. An IDE is an Integrated development environment . The name of Pythons IDE is IDLE. Python Trivia The Python Programming language is named after the television series Monty Pythons Flying Circus . The Python IDE (IDLE) is named after Eric Idle , the writer of Monty Python. 5 Downloading... Windows and Mac users: Download the 2.6.6 installer from here . Linux(Ubuntu) users: In a terminal window type: sudo apt-get install idle Appendix B of the Zelle textbook may be of some help. 6 Lets get started! Interactive Python When you start up IDLE (a.k.a. Starting the interpreter), you get get this screen: This is the Python Interpreter The >>> is the prompt . The prompt is where the computer is waiting for us to give it a command (interact with the Python interpreter). 7 Our First Interaction with the Python Interpreter At the Python prompt, give the interpreter the following command: >>> print Hello, World 8 What went wrong? >>> print Hello , World Traceback ( most recent c a l l l a s t ) : F i l e < p y s h e l l#0 > , l i n e 1 , in < module > print Hello , World NameError : name Hello is not defined >>> 9 What went wrong? >>> print Hello , World Traceback ( most recent c a l l l a s t ) : F i l e < p y s h e l l#0 > , l i n e 1 , in < module > print Hello , World NameError : name Hello is not defined >>> We have asked the Python Interpreter to display the literal phrase Hello, World, and it doesnt understand us :-( 9 Literals string literals literal strings Definition Something you want the computer to display exactly as it is written. You must enclose it in quotes! Like this: >>> print "Hello, World" 10 Syntax and Semantics A language is a set of valid words and sentences. Validity depends on syntax and semantics . 11 Syntax and Semantics A language is a set of valid words and sentences....
View Full Document

This note was uploaded on 12/14/2010 for the course ENGINEERIN 1d04 taught by Professor Smith during the Spring '10 term at McMaster University.

Page1 / 66

00 slide presentation[1] - Engineering Computation:...

This preview shows document pages 1 - 15. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online