On 2 August 2018 at 13:49, Peter Otten <__pete...@web.de> wrote:
> Oscar Benjamin wrote:
>>
>> Comparing floats for equality can be flakey. Sometimes two floats that
>> should be equal will not compare equal e.g.:
>>
> 0.01 + 0.1 - 0.1 == 0.01
>> False
>
> Do you know if there's a way to constr
Oscar Benjamin wrote:
> On 1 August 2018 at 21:38, Roger Lea Scherer wrote:
>>
>> I'm trying to get a list of tuples to be a float, a numerator, and a
>> denominator for all the fractions: halves, thirds, fourths etc up to
>> ninths. 1/2 returns the same float as 2/4, 3/6, 4/8. I would like to ke
On 1 August 2018 at 21:38, Roger Lea Scherer wrote:
>
> I'm trying to get a list of tuples to be a float, a numerator, and a
> denominator for all the fractions: halves, thirds, fourths etc up to
> ninths. 1/2 returns the same float as 2/4, 3/6, 4/8. I would like to keep
> only the 1/2. When I try
Why not sorting the items and throw out all multiples until you reach
the fixed length ?
Klaus Ramelow
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Adam Cripps wrote:
> I've not worked with Sets before but will give it a go. Is there a way
> of turning the Set back to a list?
list(mySet)
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On 1/11/07, Adam Cripps <[EMAIL PROTECTED]> wrote:
> On 1/11/07, Kent Johnson <[EMAIL PROTECTED]> wrote:
> > Adam Cripps wrote:
> > > I have a list which comprises of simple random arithmetic problems for
> > > teachers to give to their pupils. This list must be a set length (if
> > > the teacher a
Adam Cripps wrote:
> I have a list which comprises of simple random arithmetic problems for
> teachers to give to their pupils. This list must be a set length (if
> the teacher asks for 10 questions, they should get 10 questions), but
> should not have any duplicates.
>
> I've seen the use of sets