+ 3
for loop
i know i can print letter in string, like: for letter in 'bananasaregreat': print(letter) but, how do i make the output like this?: ban ana sar egr eat
2 Answers
+ 9
a = "abcdefghijklmnopqrstuvwxyz"
for i in range(0,len(a),3):
print(a[i:i+3])
+ 9
maybe you can put some counter that count to 3 and the when comes to 3 print new line and back counter to 0