9-28 & 9-29-2017

today- show me your Python skills (skillz?)

So we have worked with the following in Python:
1. functions
2. graphics
3. accepting input
4. reporting input back to the user (‘Hi’,name,’ how are you?’)
5. using if/elif/else statements
6. using nested if/elif/else statements
7. calculations: addition, subtraction, multiplication, division
8. using >,<,>=,<=
9. adding comments with a #

Now is your chance to put these skills to work in a program of your choice.  I won’t tell you what the program should do*.  That’s up to you.

Click here to describe the program that you will write.

You goal is to design a program that includes at least four of the options above.  Note that all programs must include comments that explain what is happening and demonstrate your knowledge.

Your free choice Python program must:
-be at least eight lines long
-have at least four comments that clearly explain what is happening in that section or line
-use at least four of the options above
-have proper syntax
-work when run

Submit your Free Choice program by clicking here.

*but I’m happy to talk about ideas.

9-26 & 9-27

today: while loops and greater than/less than variables

Find your old code where we used if/else to see if it’s dark outside.  Can’t find it? Enter the code below into Python and run it:

Quick tip – to indent or dedent (remove an indent) use command key and press the [ or ] key.  Try it.  Really.

How do we get this code to repeat and ask use if we want to check the sun again?  That’s the while loop.  Python is uses a while loop to check if a condition exists or does not exist.

part II: Greater/than if/else

Now try the Thermostat Program

click here to turn in your assignments after you post them to trinket.io

 

another tale of government officials and private email servers

today- finish your adventure game:
use if/else/elif to write a VERY simple Adventure Game
-have three different pathways or choices
-have at least one nested if/elif/else
-make the story short but more interesting than my traffic light example

next class: if/else/elif and math operations

click here to turn in your assignments after you post them to trinket.io

9-14-17 & 9-15-17

today’s agenda:
1. intro to integer and float variables
2. intro to mathematical operators (addition, subtraction, multiplication, division) in Python
3. Create a very simple calculator that asks the user to provide two numbers that will be added together.
4. How would you show the two variables in print to the user so that they see Here is the sum of 2 plus 3:
5.  Modify your code to subtract, multiply and divide.
6. Using string, int and float variables together.

iPhone Calculator – your next mission

Resources:
Mathematical operators with Python

Mathematical functions in Python

 

9-11-2017

Today we pause on our graphics work and begin using inputs in Python

Begin by watching my Intro to Python Inputs video.  Please pause the video as it runs so that you can add each line of code.  I will also post a screenshot of the code below.  If you don’t have headphones you can turn on closed captioning.

AFTER you have watched the video and typed in the coded I’d like you to do the following:
1. add in at least TWO MORE QUESTIONS to the code that capture inputs.  Ideas could include asking where the person lives, favorite ice cream, their Social Security number, etc.

2. use the two new inputs that you have collected in responses back to the user like I did with name and age in the tutorial.  Like print(‘Do you like living in ‘,location,’?’)

3. save your work and upload it to your trinket.io account.  Share your code with me for this graded assignment.  Click here to send me your code.

9-7 & 9-8-17

tech news: Equifax gets hacked and it’s a mess
(this is the info that Equifax keeps)

today’s goals:

  1. trinket.io – this website will be the way that you turn in your Python programs for class: here’s a sample
  2. create your very own trinket.io account – as always, take steps to protect your privacy (no full name, no info about location of your home or school) -go to trinket.io
  3. send a test to Mr. Milstead by clicking here
  4. finish your Python Turtle Graphic – be sure to add comments to your code explaining WHAT the code does.
  5. send your Completed Turtle Graphic code to Mr. Milstead by clicking here.

Get a preview of our plans for next week – this guy types in six lines of code and you won’t believe what happens next!!

9-5-17

The plan for drawing a turtle graphic
Now it’s time to create your own custom graphic.  Use the provided grid paper to plan your work.
>the distance between the thick lines is 100 pixels
>the distance between the thin lines is 25 pixels
1. comments (put a hashtag in front of comment) to tell what is happening in that section of code
2. functions
3. multiple colors
4. your own work

Creating a semicircle using Python Turtle