+ 1
What the \n for? I just want a break line, how come it show \n
5 ответов
0
in python \n is for next line
\t is for tab.
If you want to break a long statement in a function just use '\'
for example:
def print_something():
print(' This is a really long line', \
'but we can make it across multiple lines using' , \
'the backslash')
another example:
x = 10
if x == 10 or x > 0 or \
x < 100:
print (True)
0
I mean when I use ``` it show \n on my line break
0
is it Python 2 and Python 3s different
0
Yes the syntax is a bit differnt
for example in Python2 print 'hello'
and in Pyhon3 its print('hello')
0
Ok I see, thx a lots!