CMPT_165_notes_(2007-11-09)

CMPT_165_notes_(2007-11-09) - (print Pizza cost:) (print...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CMPT 165 (LEC) 2007/11/09 Why Python? - free - available for Windows, Mac, Linux - easy and simple to learn - allows us to create ‘scripts’ Syntax Error: - A programming language, like a natural language, has SYNTAX RULES. - Syntax Error occurs when you write instructions (statements) which do not follow the syntax rules of that programming language. - Python interpreter does not know what to do with (how to interpret) your instructions! Python VS XHTML: - Python is a programming language, XHTML is not. - Python produces programs - XHTML produces web pages Python: - Print - = - + - (pizzaCost = 14.95, anchovies = 2.95) (eg. pizzaCost = pizzaCost + anchovies)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: (print Pizza cost:) (print pizzaCost) => displays Pizza cost: 17.90 Computer Programming: The Big Picture 1. Problem 2. idea of how to solve 3. design (write down what you need to do to solve the problem) 4. IDLE editior (implement our Python program) 5. (F5 = Run/Execute) activates the Python interpreter 6. results of program what is displayed Example 1: Problem Statement: create a python program that prints your name and student number on the computer screen. Example 2: Problem Statement: create a Python script that generates a web page (containing your name & student number)....
View Full Document

This note was uploaded on 02/06/2011 for the course CMPT 165 taught by Professor Ramesh during the Winter '09 term at Simon Fraser.

Ask a homework question - tutors are online