0

Print 'for loop' without add new line

The default print in python is make a new line. How to print sequence in a same line using for loop?

1st Dec 2016, 6:29 PM
Luqman Raharjo
Luqman Raharjo - avatar
2 odpowiedzi
+ 1
print function in Python has more parameters than you think. you can set the 'end' parameter, which is '\n' by default, to '' (these are two single quotes). there will be no new line after this print. print ('abc', end='') print ('def')
1st Dec 2016, 7:04 PM
Demeth
Demeth - avatar
0
Thanks buddy, it's works
1st Dec 2016, 10:13 PM
Luqman Raharjo
Luqman Raharjo - avatar