Subscribe to The Linking To My Other Blog Didn't Work, So This Here Is The Result        RSS Feed
-----

Monty Hall's Problem With Eating Fruits Sieved By A Mathematician

Icon Leave Comment
I've been re learning Python and the hassle of the indent and Python cmd acting all funky on me I decided to do something on, so what I did is try out the PyDev thing for Eclipse Juno. Then I remembered I don't know how to make classes and objects and such as of yet in Python, so I closed the thing and got back on the cmd. I hope no feelings were hurt. :)

I also learned a little about list comprehensions, very neat! For example I have this list:
 fruits = ["apple","orange","kiwi"]

And another list:
 food = ["apple","orange","cake","kiwi","chocolate"]

If I wanted to get all food that isn't fruit, I can just do this:
 nonFruitFood = [ x in x for food if x not in fruits]

What do we have here?
>>> nonFruitFood
['cake', 'chocolate']


Awesome!

Oh, it's all thanks to the Monty Hall problem. Also, I got interested with Mathematics(whaaat? really?lol) because of the Sieve of Eratosthenes. I like stuff like that, it's like magic!

I hope to learn more Python and Mathematics. ^^

0 Comments On This Entry

 

Trackbacks for this entry [ Trackback URL ]

There are no Trackbacks for this entry

July 2014

S M T W T F S
  12345
6789101112
13141516171819
20212223242526
27282930 31   

Tags

Recent Entries

Recent Comments

Search My Blog

0 user(s) viewing

0 Guests
0 member(s)
0 anonymous member(s)

Categories