> Yes, that unit test was written by Danny (I assume -- I suppose he might
> have copied it from somewhere else.)
Oh, who knows where I got that code from. :P
---
Sydney, you can also take a look at some of the official documentation
of the unittest library:
https://docs.python.org/2/libra
> So this call will always try to round None(the default return value)
> And of course it produces no output since it prints nothing.
>
> Are you sure that's actually what is in the book?
No. That's very much why I wanted a reference to the original source
of the problem.
Scott attributed too m
Hi Patti,
On Tue, Apr 1, 2014 at 11:07 AM, Patti Scott wrote:
> I've been cheating: comment out the conditional statement and adjust the
> indents. But, how do I make my program run with if __name__ == 'main':
> main() at the end? I thought I understood the idea to run a module called
> directl
On Tue, Apr 1, 2014 at 6:07 PM, Patti Scott wrote:
> I've been cheating: comment out the conditional statement and adjust the
> indents. But, how do I make my program run with if __name__ == 'main':
> main() at the end? I thought I understood the idea to run a module called
> directly but not a
I've been cheating: comment out the conditional statement and adjust the
indents. But, how do I make my program run with if __name__ == 'main': main()
at the end? I thought I understood the idea to run a module called directly
but not a module imported. My program isn't running, though.
Belo
On 4/1/2014 3:26 AM, Sebastien Gomez wrote:
The vending machine must have 5 prices with items
it should accept 10p, 20p 50p and £1 coins
it should allow the user to purchase a item and give him a choice of
purchasing something else. it should display the remaining credit once
the item is purcha
I'm posting this to include you in this conversation.
Recently I got the following Request: can you write me a code in python
please or if you have one already
my response:
print('hello world')
what more can I do for you?
(next two lines are best guesses as I can't find the relevant emails.
On Tue, Apr 01, 2014 at 12:30:46PM +0100, Sydney Shall wrote:
> Another debutant!
> I am having trouble learning to use unittests.
> My question is;
> In the example below, did you write the class
> "SquareRootTests(unittest.TestCase):" ?
Yes, that unit test was written by Danny (I assume --
Another debutant!
I am having trouble learning to use unittests.
My question is;
In the example below, did you write the class
"SquareRootTests(unittest.TestCase):" ?
Or do I find a set of them in the library?
And what is the significance of the name chosen
"self.assertAlmostEqual(squ
On 01/04/14 00:22, Scott Dunning wrote:
def print_n(s,n):
i = 0
while i < n:
print s,
i += 1
print_n('a',3)
Also, with this exercise it’s using a doctest so I don’t actually call the
function
I have no idea what you mean buy this?
There is no doctest above and yo
On 01/04/14 02:07, Scott W Dunning wrote:
I’m working on a few exercises and I’m a little stuck on this one.
This is what the book has but it just gives me an endless loop.
def square_root(a, eps=1e-6):
while True:
print x
y = (x + a/x) / 2
Scott Dunning Wrote in message:
>
> On Mar 31, 2014, at 5:15 AM, Dave Angel wrote:
>>
>> Do you know how to define and initialize a second local variable?
>> Create one called i, with a value zero.
>>
>> You test expression will not have a literal, but compare the two
>> locals. And the st
Scott W Dunning Wrote in message:
> Iâm working on a few exercises and Iâm a little stuck on this one.
>
> This is what the book has but it just gives me an endless loop.
>
> def square_root(a, eps=1e-6):
> while True:
> print x
> y = (x + a/x) / 2
>
On 01/04/2014 02:47, Danny Yoo wrote:
On Mar 31, 2014 6:22 PM, "Scott W Dunning" mailto:scott@cox.net>> wrote:
>
> I’m working on a few exercises and I’m a little stuck on this one.
>
> This is what the book has but it just gives me an endless loop.
>
> def square_root(a, eps=1e-6):
>
On Mar 31, 2014, at 5:15 AM, Dave Angel wrote:
>
> Do you know how to define and initialize a second local variable?
> Create one called i, with a value zero.
>
> You test expression will not have a literal, but compare the two
> locals. And the statement that increments will change i, not
15 matches
Mail list logo