#Ch5 Loops and iterations
a = 5
while a > 0:
a = a - 1
#if only goes off once, while goes off as long as "if" is true
#iteration variable - some variable that changes each loop
#Infinite loops (b = b - 1 is necessary)
b = 5
This file contains the actual data for your assignment - good luck!
Why should you learn to write programs?
Writing programs (or programming) is a very creative
and rewarding activity. You can write programs for
many reasons, ranging from making your li
Writing programs or programming is a very creative
and rewarding activity You can write programs for
many reasons ranging from making your living to solving
a difficult data analysis problem to having fun to helping
someone else solve a problem This book
Hello, it's Anthony Bourdain.
No, no, it's actually not Anthony
It's, Dr. Chuck, and we are here in Miami,
Florida for another, office hours, for our
And I want you to meet some of your fellow
So say hi.
And welcome to our short little
lecture on peer grading assignments.
Since this is often a
first class for people
on Coursera and peer grading assignments
may be something that
are seen differently in different
cultures, I figure I'll
just do a l
When you're doing production design
there is this idea
that you need to be able to
Because one of the, in a way,
important elements of that
discipline is being able to test the
things you do with people.
Okay, so we're almost done with
I want to show you one more kind of
It's a little bit different.
It's not a bit of code structure
that you make, it is,
it is dealing with the fact that some
things may blow up.
Like, if you read
Welcome to our Worked Exercise.
This is Dr. Charles Severance and Worked
Exercises from Python for Informatics.
This material is copyright Creative
Commons Attribution 3.0.
And if you need basic guidance on
how to install
Python or use your text editor i
Hello, and welcome to Chapter Three of
Python for Informatics.
Chapter One, Chapter Two, now we're
going to get to something kind of
I mean, assignment statements and reserved
words, that just kind of gurgling.
Now we're going to start seeing
Hello, and welcome to a worked
exercise for Python for Informatics:
I am your host, Charles Severance, and
this material is copyright Creative
So again, you're supposed to try to
work these exercises yourself be
Hello and welcome to our first assignment,
writing the classic Hello World program.
We do this Hello World program to some
sort of prove that we can get ourselves
inside the computer.
I think of Hello World as putting
the computer a
Hello and welcome to Programming for
Everybody. My name's Charles Severance I'm
a Clinical Associate Professor at the
University of Michigan School of
And I'm your instructor for this class.
I'm glad you're here.
So the first thing I always l
So, we always start all programming
classes with hardware architecture.
I, I don't think it's essential, so don't
get too excited about it.
It's a good
use of terminology so we can have some
like, say, like CPU and you don't freak
Or memory, or
Hello and welcome to Chapter 11, Regular
from the book Python for Informatics:
As always, these slides are copyright
Creative Commons Attribution, as well as
the audio and the video that you're
watching or listening to
Hello, and welcome to yet another Worked
Exercise for Python for Informatics:
I'm Charles Severance, I am your tour
guide to this particular worked example.
And this material is Creative Commons
Attribution, and I hope to
see the cl
Right, so it started in 1993, when I saw
the Mosaic web browser.
That was when I got really interested in
I'd been doing Gopher and IRC and other
Internet-related things before then.
But with Mosaic, I could suddenly explain
what I was do
Hello, and welcome to the reality show
about exercises in Python.
It's not a very exciting reality show, but
I'm your host, Charles Severance.
And these exercises come from Python for
Informatics: Exploring Information.
And, of course this material's Crea
Hello, and welcome to Chapter Six.
This chapter we're going to
talk about strings, and
stuff is going to start to get real now.
So, as always, this material, this video,
slides and book are copyright Creative
I want you to use t
Good students get a better understanding
of something if they know the history of it.
If they know where, if they know
where it's come from.
That's my, my view.
So when I go to class, andI go to the
interface design class, for instance, I
Hello and welcome to yet another Worked
Exercise from Python for Informatics
My name is Charles Severance and I am your
I'm your personal trainer, your personal
Welcome to the software development gym.
When I returned to Switzerland, I got
an invitation at the University
of Zurich and at the ETH to introduce
computer science as a new subject.
And, of course, being a self-trained man
I looked what tools were available and
that was ra
Hello and welcome to Chapter 5,
loops and iteration.
As always, this lecture is copyright
Creative Commons Attribution, including
the audio and video and, and the
slides, and the book even.
So, now we're getting to our
fourth basic pattern.
We've talked a
Hello, and welcome to yet another worked
exercise for Python for Informatics:
I'm your exercise worker Charles
Severance, I'm the author of the book.
And as always, this material, as well
as the book itself, is Creative Commons
Our company's mission is to
educate the world.
We believe that education is the great
equalizer and that many of
the world's problems
could be made a lot better if more people
had access to education, and that
includes problems like unemploymen
Here's this largest value one I've used
before and you know, away we go.
We, you know, we have
largest_so_far, we check to see
if the one we're looking at is better
and if it is we keep it and then away we
go and we find that the largest is 17.
Loop idioms are how we construct loops.
And we're going to, the loops kind of
have some kind of a goal in mind.
Finding the largest, we played with that.
Finding the smallest, counting the
number of things,
looking for lines that start with pound
Hello, and welcome to Chapter Four,
Functions, in the book Python for
As always, these slides and this audio and
this video are copyright Creative
Now we are to the point, you know, Chapter
Four, we're sort of well into t
Hello, and welcome to the worked
exercise for Python For Informatics,
I'm Charles Severance, and I'm your guide
and guest programmer for this
As always, this material is copyright
Creative Commons Attribution.
So, we saw in that previous thing one
block within a block.
And, and we're going to do that.
We can have ifs, we can have loops that
get indented, but then we can indent even
We call that nested, where there's an
area that's in an area that