+ 1
New line is not printing in print by using stings....why..?
eg:print("hello\nworld"*3) here in this example out is not printing like :hello world three times it is printing same line 3 times...
3 Answers
+ 2
Try this:
print("hello\nworld\n"*3)
0
It's because the "\n" is at the middle of the string, not the end.
Here's the correct code ::
print("Hello World\n"*3)
0
use
print('hello'+('/n'*3)+'world')
because you are using will print the entire string three times.