Spring 2021 -- Peter Brooks
|Some Python documentation...|
.split() and .join()
CSV exercises, due: Thurs 4/15 (pds 3,4)
Fri, 4/16 (pds 9,10)
.split() and .join are very useful string methods.
Here's how they work.
A lot of data comes in .CSV format (Comma-Separated Values). Here's a first set of exercises that asks you to process such data...
Homework due: Tue, 4/13 (pds 3,4)
Wed, 4/14 (pds 9,10)
Once you know about strings, indexing and slicing, lists are an easy
List homework #1
|Even more on strings...||
Strings, strings, more strings
Due Wed 4/7 (pd 2,3),
Thurs (pd 9, 10).
We take a look at string methods, like
.upper() and .find() and can
use them for string transformations, like encryption.
Do the following string exercises, which will be due after the break.
Here are my answers.
Due on CodingBat
Wed 3/24 (pds 3,4),
Thurs 3/25 (pds 9,10)
are ways of
storing characters as numbers. You can find the code for a
letter (e.g. for ASCII code for "A" is 65) using
ord("A") -> 65, and in reverse,
chr(65) -> "A"
You can then "shift" each upper-case character in a word forward by one (e.g. "A" -> "B", and "B" -> "C", ... "Z" -> "A") with
if c == "Z":
return chr(ord(c) + 1)
Do the CodingBat exercises:
shiftCharacterByOne, shiftCharacter, shiftWordByOne, shiftWord
Using for and
range() for looping.
Python #3 homework due
3/22 8:00a for pds 3,4
3/23 8:00a for pds 9,10
examples of the use of
to create loops. Also, here is the use of
to terminate a loop prematurely.
In a belated celebration of Pi day (yes, we missed it... why didn't y'all say something ... huh?), we'll have Pi calculations. Yes!
Here are a couple of exercises, plus optional (if you really like math) problems having to do with Pi.
My answers are here.
Strings, and more strings.
Homework due before next meeting (Thurs or Fri, 3/18,19)
|We're starting to work with CodingBat||
CodingBat (with Mr. Konstantinovich's additions) is a site with
Python (and Java) problems, and has an online tester.
Python homework #2:
Due (periods 3,4): Wed 8:00
(periods 9,10): Thurs 8:00
Answers are here. Remember that there are many ways to solve these problems correctly, and my answers are not unique, nor necessarily the best.
Personal homepages are up!
Voting due by Thurs night, 3/11
Vote for the 2 best homepages on the form HERE...
First of all, most of these webpages, competitive and non-, were an enormous amount of work (yes, I know). And the outpouring of sheer creativity never fails to make me proud of the students in this course. A quiet thank-you to you all.
The Big Nos: No you can't vote for yourself; No, you can't vote for the same person twice; No, you can't vote for someone in another class; No, you can't sell your vote (or barter).
1st prize is 2 extra points on final course grade (except over 100); 2nd prize: 1 extra point.
First Python homework
Due (periods 3,4): Mon 8:00
(periods 9,10) Tue 8:00
Download this file (python-demo-1.txt),
then change its suffix from ".txt" to ".py" and then load it into
Python exercises #1
Answers are Here.
For Tues/Wed, 3/2,3/3 classtime
|Download, install, and run Thonny, our preferred Python development environment (although you can use others).|
Privacy, security and
Files/Directories, directory trees
|Wed/Thurs, 2/24-25: Imitate this page task||
In your breakout rooms, collectively figure out how to imitate this
page. Here are the
notes/suggestions for doing so, and
here's the good ol'
Here's the actual webpage, so that you can View-Source and see the HTML and CSS I used to create it.
|Homework #3, Your personal homepage: to be finished by Sun 2/28 night.||
Create a webpage or set of webpages about yourself.
You can talk about /show your interests, hobbies, sports, music, etc.
This will be published on moe.stuy.edu one of our CS dept. servers.
Rules: you may NOT use a web-authoring program (like DreamWeaver) -- just a text-editor.
Put the URL of your page (e.g. here's a simple one about Mr. Brooks's books http://moe.stuy.edu/~pbrooks/books/BookPage.html) into the Comments-to-Teacher, along with a sentence or two about your experience in creating it.
Also, add whether you want to enter it into the class competition . If you say nothing, you won't be entered, but your URL will still be posted on the competition page (just like in the Shape/locomotion competition).
|Daily Double Digital||
The Daily Double Digital is a 4-minute presentation on any digital
topic that would be of interest to the class. Be prepared for
a couple of minutes of questions.
There will be 2 presentations at the beginning of each class period.
The Schedule is here.
It is your responsibility to know when you're up. If you need to cancel, provide me the reason for it at least a day in advance, otherwise it's a no-show.
|Connecting to our CS server||
You'll be connecting to the computer:
You can use one of several free File Transfer Programs: FileZilla (Windows, Mac & Linux), or WinSCP (Windows only)
In FileZilla, the settings are:
username: your user name, like hpotter30
password: your password
|HTML/CSS References and Resources||
Here are the great resources that y'all found out there. These
will be useful for constructing your personal homepage(s).
Period 3's finds
Period 4's finds
Period 9's finds
Periods 10's finds
Wed 2/10 8:00 for periods 3,4
Thurs 2/11 8:00 for periods 9,10
|Create a document like this for all of the HTML (and any CSS) codes that we have covered. Save that document in .PDF format and submit to the homework server. I'd gently recommend changing my name to yours.|
|Homework #1, due 8:00a before next class||
Check out the W3Schools site -- learn to use it.
Find and report on a good source of HTML and CSS information other than W3Schools, that's perhaps easier to work with, or has some other advantage. Post its URL in the Comments-to-Teacher, and say why it's better in some way.
|For Mac users of TextEdit:||
TextEdit is the built-in editor for plain text files, but it
defaults to rendering html, rather than displaying it. You can set
its preferences to support editing html:
In the menu TextEdit > Preferences, on the New Document tab
|First task: fill out your Profile on the Homework server.||
|Help from Mr. Brooks||Feel free to come to the class
Rocket.chat channel: #office-hours during office hours or make an
appointment with me by email.
Office Hours Zoom (sometimes) -- preferably, send me email beforehand if you will want to Zoom-talk... I will also be on the Rocket.chat channel: office-hours
Meeting ID: 811 5113 1539
Sending email to Mr. Brooks:
||Send mail to:
You MUST include your name in the subject line or body of the message, otherwise I won't know who it's from.
|Stuyvesant bell schedule|