— This is argueable, though. i didnt run tests to ensure this is true. im only telling my experience
— How can I get first 3 line of a string?
— I tried to use split but no effort
—
"""
1
2
3
""".split('\n')[:3]
doesnt works?
— I didn't put the : before 3 there
— Its a slice. basically this means taking "from 0 to 2"
— Ok but I think my problem is not with the method....I got an error
— Lol the result from this thing is ['', '1', '2']
— Thats because the first line has nothing