ch02-IntroductionToProgramming
ch02-IntroductionToProgramming
Programming
-12
Barbara Ericson
Mark
Inside the computer, 85 5th Street NW
these are all just bits
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights
Strings
reserved.
Our programs work with
a variety of names
You will name your functions
Just like functions you knew in math, like sine
and gcd (Greatest Common Divisor)
You will name your data (variables)
You will name the data that your functions
work on
Inputs, like the 90 in sine(90)
Key: Names inside a function only have
meaning while the function is being executed
by the computer. (More on this later.)
Program Area
Command Area
2. print 4 / 6.0
3. print 4 % 3
4. print 4 % 3.5
>>> file=pickAFile()
>>> print file
C:\Documents and Settings\Mark Guzdial\My
Documents\mediasources\barbara.jpg
>>> show(makePicture(file))
>>> show(makePicture(r"C:\Documents and
Settings\Mark Guzdial\My Documents\
mediasources\barbara.jpg"))
>>> show(makePicture(pickAFile()))