Hi
I'm trying to program a merge sort algorithm on python but it just doesn't work!
I first implemented a fusion algorithm which takes as arguments a list A divided into 2 sorted sub lists A[p..q] and A[q+1..r]. Fusion then returns the list A completely sorted.
This program seems to work...
Hi,
I'm studying algorithmic on "Introduction to algorithms" by Cormen, Rivest, Stein and Leiserson.
This book is very well done and proposes more than a thousand exercises, but the point is these exercises are not corrected. It enables us to really search them, but it is frustrating when you...
A and B are nested lists indeed.
They look like A=[[1,2,3],[2,3,4],[2,2,3]] for instance.
But what amazes me is that when I try to work with A[0][0] in the python shell, then there is absolutely no problem whereas with my program (with IDLE) an error is raised...
Hi all!
I'm learning programming on Python.
Currently, I'm trying to implement a recursive algorithm using a divide and conquer method to compute a product of matrices.
Yet an error occurs when I try to assign an element in a list (representing a matrix)
I can't understand where the problem...
Yes I did notice the line you added. But it still raises the same kind of exception.
Do you mean that instead of printing things like "wrong number"... I should return these?
Thank you emgram769: In fact that's almost what I tried to do but I took the second integral with -theta instead of 0 (and we should take 0 because phi is integrated over 2Pi)
Hi everyone
I'd like to compute the solide angle defined by a cone whose angle θ is known.
I tried with the definition but I probably mistook since it lead me to compute an integral worth...0.
I then tried with a rule of three, but the result I get is clearly wrong too.
Could you...
I'm afraid the first way doesn't work, it generates the following exception:
UnboundLocalError: local variable 'col' referenced before assignment
About your second suggestion: Could you tell me how to exit the function please? (I just begging in programming)
Hi Radou
Here's my program (edited with IDLE)
The problem occurs when I execute Roulette() on python's shell and when I choose 'No' when he asks me whether I want to play
I didn't put much comments on my program, so if there is something you don't understand, just ask.
Since I can't...
Hi guys
I'm trying to program a Roulette game on Python
My programs asks for inputs and I gave names to these inputs.
The point is, since I didn't assign these names before, the following error occurs:
UnboundLocalError: local variable 'color' referenced before assignment
I tried to get...