PythonGroup
Welcome, Guest. Please login or register.
September 09, 2010, 12:37:30 AM

Login with username, password and session length
Search:     Advanced search
The Notify button enables registered members to subscribe to email notifications.
66 Posts in 17 Topics by 28 Members
Latest Member: nikhil
* Home Help Login Register
+  PythonGroup
|-+  Core Python Programming
| |-+  Core Python Programming (The Book)
| | |-+  Chapter Five April 1 => April 15
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: Chapter Five April 1 => April 15  (Read 299 times)
comprookie2000
Administrator
Newbie
*****
Offline Offline

Posts: 48



View Profile WWW
« on: January 29, 2010, 12:34:56 PM »

Starting to get a little more serious here, Numbers  Huh
Exercises: http://asterisklinks.com/wiki/doku.php?id=core:part5
« Last Edit: January 31, 2010, 01:39:20 PM by comprookie2000 » Logged

polymath
Newbie
*
Offline Offline

Posts: 10


View Profile
« Reply #1 on: February 19, 2010, 04:38:26 AM »

Hi comprookie

First, thank for your code submissions.
I've checked out a couple of your solutions that you have
made comments on.

5-8).
I ran this one (with minor adjustment for Python 3.1) and
your math works just fine. One *very* minor detail: maybe
pi could have a couple of extra digits.

What is this 'class' thingy you used?

5-11). part d.
I think that this is the solution the author is looking for.
You didn't waste a single character to ansewer it - perfect.

5-12).
I used the BIFs to find the required information, which i
didn't understand. I think the point is that, at sometime
should we need this info, we know where to find it.

5-17).
I struggled with this one. As usual for me, i didn't read
the question thoroughly.
Briefly, i think this is what is asked for:

generate a list of 100  random integers between the values
1 and (2 ** 31) - 1. List1[] (say)

Then select a random number (a subset or collection) from List1[]
put them in List2[] (say).

Now sort List2[] and display it.
Done!

I hope this feedback will help you and others.
I accept that i could be wrong or that someone may have better
(and sexier) way to solve a problem.

Regards, PolyMath.
Logged
comprookie2000
Administrator
Newbie
*****
Offline Offline

Posts: 48



View Profile WWW
« Reply #2 on: February 19, 2010, 11:53:21 AM »

Hi comprookie

First, thank for your code submissions.
I've checked out a couple of your solutions that you have
made comments on.
Your welcome
Quote
What is this 'class' thingy you used?
If your going to use the same values over and over it is sometimes best to create a class for it.
I am still learning so I will sometimes practice if it fits that.
here are some simple ones, we will get to them later anyway Smiley
http://asterisklinks.com/wiki/doku.php?id=wiki:comprookie2000#classes
Quote
I hope this feedback will help you and others.
I accept that i could be wrong or that someone may have better
(and sexier) way to solve a problem.

Regards, PolyMath.


Yes it helps keep it coming
Logged

Pages: [1] Go Up Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.8 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!