CS101.Lect25.Python.InputOutput.DefiniteLoop.ppt

CS101.Lect25.Python.InputOutput.DefiniteLoop.ppt - CS101...

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

View Full Document Right Arrow Icon
1 1 Aaron Stevens 30 March 2011 CS101 Lecture 25: Python Input, Output and the Definite Loop 2 Overview/Questions – Review: variables and arithmetic operations – Input and output to a Python program – ASCII encoding and decoding – The definite loop
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 3 Variables A variable is a spot in memory which can hold a value. – The value is stored using a name we chose. – We can recall it when needed to use the value, or change it to hold something else. x = 42 4 Elements of Programs Identifiers Programmers use names to identify modules (e.g. hello.py), functions (e.g. main), and variables (e.g. pesos) within programs. Variables Give names to values within programs
Background image of page 2
3 5 Identifier Naming Rules Identifiers in Python follow these rules: Must begin with a letter or underscore _ May contain letters, numbers, underscores May not contain spaces, punctuation, etc. May not be Python keywords Are case sensitive 9thValue print hello there my.favorite.letter x x1 dollars dollarsAndCents
Background image of page 3

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

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

Page1 / 8

CS101.Lect25.Python.InputOutput.DefiniteLoop.ppt - CS101...

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

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