5 Answers
New AnswerHaider It should look like this and work both in PyCharm and Sololearn: https://code.sololearn.com/cQQJt6czq4MZ/?ref=app
Import it like this: "from itertools import takewhile". Then you can use "takewhile" in your code. Don't write "itertools.takewhile"
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message