Re: [Tutor] Finding the max value from a dictionary that does not exceed a variable's value.

2016-02-01 Thread Danny Yoo
> > It was acknowledged that "OP's problem doesn't need this" so I assume > the question was to think about it more generally somehow. > While we're on wild tangents... We should probably note, since it hasn't been mentioned yet, that the generalized problem with arbitrary coin choices is classi

Re: [Tutor] Finding the max value from a dictionary that does not exceed a variable's value.

2016-02-01 Thread Oscar Benjamin
On 1 February 2016 at 13:29, Steven D'Aprano wrote: >> > although OP's problem doesn't need this, is there a better way achieve >> > this other than >> > using a balanced binary search tree. >> >> You would need to state all of the requirements for your data >> structure. If coinvalues is constant

Re: [Tutor] Finding the max value from a dictionary that does not exceed a variable's value.

2016-02-01 Thread Steven D'Aprano
On Mon, Feb 01, 2016 at 12:47:02PM +, Oscar Benjamin wrote: > On 31 January 2016 at 05:50, srinivas devaki > wrote: > > On Sun, Jan 31, 2016 at 3:54 AM, Danny Yoo wrote: > >> --- > >> I want to take the max value in the dictionary 'coinvalues' that is the > >> same as or lower than the vari

Re: [Tutor] Finding the max value from a dictionary that does not exceed a variable's value.

2016-02-01 Thread Oscar Benjamin
On 31 January 2016 at 05:50, srinivas devaki wrote: > On Sun, Jan 31, 2016 at 3:54 AM, Danny Yoo wrote: >> --- >> I want to take the max value in the dictionary 'coinvalues' that is the >> same as or lower than the variable 'change'. I have no idea how to search >> through the 'coinvalues' dict

Re: [Tutor] Finding the max value from a dictionary that does not exceed a variable's value.

2016-01-31 Thread srinivas devaki
On Sun, Jan 31, 2016 at 3:54 AM, Danny Yoo wrote: > --- > I want to take the max value in the dictionary 'coinvalues' that is the > same as or lower than the variable 'change'. I have no idea how to search > through the 'coinvalues' dictionary and find the value that is highest but > does not ex

Re: [Tutor] Finding the max value from a dictionary that does not exceed a variable's value.

2016-01-30 Thread Steven D'Aprano
On Sat, Jan 30, 2016 at 02:28:50PM +, Lawrence Lorenzo wrote: > #The user enters a cost and then the amount of money given. You should > #write a program that works out what denominations of change should be > #given in pounds, 50p, 20p, 10p etc.#to do this the programme needs to > #divide

Re: [Tutor] Finding the max value from a dictionary that does not exceed a variable's value.

2016-01-30 Thread Danny Yoo
On Jan 30, 2016 12:22 PM, "Lawrence Lorenzo" wrote: > > The problem I am facing is commented in the code. Let me cut out the code, as frankly it's a *huge* distraction from your question. Here is the question you are asking: --- I want to take the max value in the dictionary 'coinvalues' that

Re: [Tutor] Finding the max value from a dictionary that does not exceed a variable's value.

2016-01-30 Thread Danny Yoo
> > Do you already know how to trailer the maximum or minimum of a list of numbers? Apologies. Substitute the word "trailer" with "take". I didn't check the output of the spelling checker as carefully as I should have. ___ Tutor maillist - Tutor@pyth

[Tutor] Finding the max value from a dictionary that does not exceed a variable's value.

2016-01-30 Thread Lawrence Lorenzo
The problem I am facing is commented in the code. Thanks for any help in advance.===#15 Change Return Program #The user enters a cost and then the amount of money given. You should write a