On 21 August 2015 at 02:57, Alan Gauld wrote:
> On 20/08/15 09:51, Srihari Vijayaraghavan wrote:
>
>> In general I agree, but this is what the os.walk() document states:
>> "... When topdown is True, the caller can modify the dirnames list
>> in-place (perhaps using del or slice assignment)..."
>
Op 20-08-15 om 16:49 schreef Aravind Jaya:
time = input("How long on average do you spend on the computer per day?")
if time <= 2:
print "Message1"
else:
print "Message2"
This will raise 2 errors:
- time will be a string. So time <= 2 is invalid.
- print is a function.
Updated co
On 20/08/2015 15:49, Aravind Jaya wrote:
time = input("How long on average do you spend on the computer per day?")
if time <= 2:
print "Message1"
else:
print "Message2"
If you insist on top posting you could at least get your response
correct. The comparison will fail in Python 3.3
On 2015-08-20 23:16, Peter Otten wrote:
Yea, breaking things is an art form ;)
$ python3 -m unittest -h
usage: python3 -m unittest [-h] [-v] [-q] [-f] [-c] [-b] [tests [tests
...]]
.
For test discovery all test modules must be importable from the top
level
directory of the proje
On Fri, Aug 21, 2015 at 1:16 AM, Peter Otten <__pete...@web.de> wrote:
> boB Stepp wrote:
>
>> On Thu, Aug 20, 2015 at 10:13 PM, Steven D'Aprano
>> wrote:
>>> On Thu, Aug 20, 2015 at 09:01:50PM -0500, boB Stepp wrote:
>>>
>>>
import unittest
# import modules to be tested:
impor
In a message of Fri, 21 Aug 2015 06:26:11 -0700, Alex Kleider writes:
>On 2015-08-20 23:16, Peter Otten wrote:
>
>
>> Yea, breaking things is an art form ;)
>
>
>> $ python3 -m unittest -h
>> usage: python3 -m unittest [-h] [-v] [-q] [-f] [-c] [-b] [tests [tests
>> ...]]
>>
>.
>>
>> For test
This code:
import sys
x = sys.maxsize
print ("Max size is: ", x)
y = (x + 1)
print ("y is", type(y), "with a value of", y)
Produces this result:
Max size is: 9223372036854775807
y is with a value of 9223372036854775808
I was expecting it to error out but instead it produces a value greeter th
In a message of Fri, 21 Aug 2015 14:04:18 -0400, Jon Paris writes:
>This code:
>
>import sys
>x = sys.maxsize
>print ("Max size is: ", x)
>y = (x + 1)
>print ("y is", type(y), "with a value of", y)
>
>Produces this result:
>
>Max size is: 9223372036854775807
>y is with a value of 9223372036854775
On 21/08/15 19:04, Jon Paris wrote:
Max size is: 9223372036854775807
y is with a value of 9223372036854775808
I was expecting it to error out
The documentation says:
---
sys.maxsize
An integer giving the maximum value a variable of type
Py_ssize_t can take. It’s usually
Joseph Gulizia schreef op 2015-08-20 05:12:
Assume that the grader defines two variables A and B for you. Write a
program which prints out the value
min(A, B)
However, there is a catch: your program is not allowed to use the min
function. Instead, use max in a clever way to simulate min.
---
On Fri, Aug 21, 2015 at 4:58 PM, Roel Schroeven wrote:
> Joseph Gulizia schreef op 2015-08-20 05:12:
>>
>> Assume that the grader defines two variables A and B for you. Write a
>> program which prints out the value
>> min(A, B)
>>
>> However, there is a catch: your program is not allowed to use th
Joel Goldstick schreef op 2015-08-21 23:22:
so:
print -max(-A, -B)
That's what I mean, yes. I haven't tried it, but I don't see why it
wouldn't work.
Regards,
Roel
--
The saddest aspect of life right now is that science gathers knowledge
faster than society gathers wisdom.
-- Isaac A
12 matches
Mail list logo