So, in my digging about on the intertubes I came across this neat little Python problem about birthdays and the probability of them occurring on the same day within a small group of people and I thought it was pretty spiffy.
Yes... I said "spiffy." First of all, I'd like everyone to read through the article and take a good look-over at the code. The page is set up so you can view and run the code right in your browser, so take advantage of that and look under the hood. After you've chewed through that, I'd like YOU to come up with your own take on this type of problem. Think about how you can use what you've read to make your own probability tester with random inputs. Apples on trees, bacteria in a petri dish, boils on a plague victim... that sort of thing. Write it up, test it out and we'll share them on Monday! Woo! Plague! Here are the videos I showed in class on Python and Arduino.
The first video is about controlling a servo via python. The second video is the more involved moving a motor via a mobile device. And here is the corresponding website which he has all the code on. And finally, here's the over the top goal for what we can do with our telescope. Here's the link to the latest part of the space based adventure game being written. I'm hoping there's more to come. He does get into modules and classes a bit, but I'll endevour to
Don't let the mane intimidate you. "Learn Python, the hard way" is actually pretty fabulous, plus, he's really good at breaking things down into chewable
Here's a good video for you to check out if you want a intro to inputs.
https://www.youtube.com/watch?v=-Xyh9RUJuyE Today, we worked on three problems we solved with Python. Here they are...
#1. The Ladybug Problem: We need 125 ladybugs to protect a tree from aphids. We have 2600 ladybugs. There are 20 trees. Write a program to test if we have enough. If there are, have it print, “There are enough ladybugs. We are safe.” If there are not, have it print, “We need more ladybugs. The orchard is doomed!” #2. Make a program that fills in an invite. The variables are… Time=7:00 Place=”Portland Pie” Who=”Zorro” Have the programs print statement including these assigned variables so they can be easily changed. “You are invited to a party… #3. Use “if” to check if “today” is equal to “Saturday” or “Sunday” If it is, then print the string, “Sleeping in” If it is not, then print, “Time to get up” Tomorrow we'll try to look at some of the solutions. -M |