Le 11/10/2015 19:12, eetix letix a écrit :
Hi,
I'm sorry but the last version of Python (3.5.0) had a problem. I
start and I meet this problem :
>>>a=5
>>>if a>0:
. . . print("a is a positive.")
. . . if a<0:
^
SyntaxError: invalid syntax
>>>
Normally this should work but problem comes to the fact that Python
considers "a" is a positive number and refuses to do the command >>>if
a<0:
And the command |\n is doesn't working :
|
|>>> a="test||\nto||\nsee||\nif||\nit||\nis||\nworking"
|
|>>> a
|
|'||test||\nto||\nsee||\nif||\nit||\nis||\nworking'
>>>
|
Normally, \n should make that the text returns to the line but doesn't
make it. And if y do :
>>> a="""test
. . . to
. . . see
. . . if
. . . it
. . . is
. . . working"""
>>>a
|'||test||\nto||\nsee||\nif||\nit||\nis||\nworking'
>>>
|
|Thanks to fix this problems and good luck ;)
|
|PS : I'm sorry for this really bad english but I'm french and I'm 14
|
Hi,
see:
>>> a = 5
>>> if a > 0:
... print('a is a positive')
... # here, type a Enter
a is a positive
>>> elif a ....
>>> a = "test\nto\nsee\nif\nit\nis\nworking"
>>> a
'test\nto\nsee\nif\nit\nis\nworking'
>>> print(a)
test
to
see
if
it
is
working
>>>
Clear ?
Vincent
--
https://mail.python.org/mailman/listinfo/python-list