Did I miss something? Can someone explain how this worked? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Did I miss something? Can someone explain how this worked?

Don't remember learning about 'x. strip()' https://code.sololearn.com/cWbKD0TAW6tm/?ref=app

13th Nov 2021, 8:58 PM
Aaron Morgan
1 Answer
+ 1
lines in file are: Harry Potter The Hunger Games Pride and Prejudice Gone with the Wind num is List of this lines for each line in list it prints: first character + length of line, but without spaces and \n at the end (it's rstrip() job) H12 T16 P19 G18
14th Nov 2021, 1:22 AM
zemiak