One of the skills I am trying to learn is nested commands in Python as I am learning Python being a newbie. As such I have come up with this code. I am not sure what the mistake is. Here is the code:
file = open ("C:\\Users\\text.txt", "r")print(file.read())while True: content=file.readline() if not content: break return int(content.find(str(i)) for i in range (10))
The output I am getting is "SyntaxError: 'return' outside function". Despite the obvious, I cannot find where my error is. Some help please!
From reading each line of the file to return every number it finds on that line, whether that number is in between the word or standing alone.