New skills: meeting multiple conditions
The first example uses an integer.
The second example uses a string.
Assignment – calculate the user’s Chinese Zodiac and turn it in here.
Archie Williams High School Computer Programming
Agenda, calendar, resources, assignments and projects for Computer Programming.
New skills: meeting multiple conditions
The first example uses an integer.
The second example uses a string.
Assignment – calculate the user’s Chinese Zodiac and turn it in here.
Continue your work on your October Free Choice program. This is due at the end of class today.
Continue your work on your October Free Choice program. This is due at the end of Tuesday/Wednesday’s class.
Make sure that you have submitted your October Free Choice program proposal with description. Click here to submit your proposal.
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.
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
revisit if/elif/else – on the big screen and resources here
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
today’s agenda:
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
Apple (most amazing since the last) iPhone reveal
today’s agenda:
1. Variable review
2. Practice together- formatting spacing and new lines for text and strings
3. On your own -create a Digital Mad Lib
Next class: working with integers as variables and creating calculations.