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:
And another list:
If I wanted to get all food that isn't fruit, I can just do this:
What do we have here?
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. ^^
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 ]
Tags
My Blog Links
Recent Entries
Recent Comments
Search My Blog
0 user(s) viewing
0 Guests
0 member(s)
0 anonymous member(s)
0 member(s)
0 anonymous member(s)
Categories
|
|



Leave Comment










|