Strings | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Strings

print('Hello'*5) this is my program, it's giving the output as HelloHelloHelloHelloHello but what should i do to print the same with spaces between each Hello.

25th Aug 2019, 6:05 AM
DINESH REDDY
DINESH REDDY - avatar
2 Answers
+ 4
Try print('Hello '*5)
25th Aug 2019, 6:08 AM
Ketchup🍅
Ketchup🍅 - avatar
0
print('hello '*5) or print('hello\t'*5) -> this will create 8 spaces And if you want to print hello on every next line so do this print('hello\n'*5)
10th Sep 2019, 9:38 PM
Shazib Mustafa
Shazib Mustafa - avatar