+ 3
What does this code before the for loop do?
Hi, I have this code where it will split a string into a list containing 2 characters each, but I don't understand what does the "(string[i:i+n])" before the "for" does May anyone explain? Answers appreciated https://code.sololearn.com/cy7BHXoFS7K4
4 odpowiedzi
+ 4
Ah, Steven Sim, then it's about comprehensions!
Take a look here:
https://code.sololearn.com/ck6HicJ6Z8jG/?ref=app
+ 4
That's slice notation.
Take a look at the link.
(If it's still not clear, please keep asking.)
https://www.sololearn.com/learn/JUMP_LINK__&&__Python__&&__JUMP_LINK/2453/?ref=app
+ 3
I had a weird problem while trying to send my answer.
I have my answer in this code:
https://code.sololearn.com/c8aZ2pnhsYmO/?ref=app