|Markon||ironfroggy: can you see here http://forum.ubuntu-it.org/index.php?topic=78865.0 ?|
|ironfroggy||x%2 is true if x is odd|
|Markon||(i'm italian, sorry :( )|
|ironfroggy||Markon: which is even and odd? i dont speak italian.|
im guessing pari is even?
as in "pair"
|Markon||ironfroggy: yeah ;)|
if x%2: print "odd"
else: print "even"
|plastic_wrap||ironfroggy: queues... good idea. i think i need to refactor this code.|
|Markon||uhm, my problem is " None"|
ironfroggy: my problem is
|ironfroggy||because you are printing the return value of the Confronta() function, which has no explicit return|
so it returns None
|Markon||ahhh ok ok , thanks ;)|
|ironfroggy||you can either just call it, without the print statement. or instead of the two print statements inside it, you can have it return the message and then print that.|
i suggest the second.
|Markon||thank you :D|
|ironfroggy||also i suggest against the use of the input function|
and would encourage you use int(raw_input()) instead
|Markon||uhm... ok :D|
|ironfroggy||input() actually evaluates anything the user enters as python code|
so it can be dangerous
it was a really dumb idea, basically.
hopefully it gets pulled
|Markon||so I will use "return" and "int(raw_input())" ok|
|eugman||Since a file is an iterable does that mean it can be slices?|
iteration does not imply slicing
|eugman||Ok so if I want a list of the lines from line x to line y what's the best way to do that?|
|Vegar||Is there a way to get the output of PyErr_Print() in a variable, or rather, a way to get a string containing what PyErr_Print() prints?|
from the itertools module
|samu2||Can't you do file.readlines()[fromline:toline] ?|