• Give me your hand

Question related to mission Non Empty Lines

 

Hi, everyone!I have been sitting with this task for 2 hours...Can you help me to solve this drill? Name of this task is 'non empty lines'

def non_empty_lines(text: str) -> int:
    # your code here



if __name__ == '__main__':
    print("Example:")
    print(non_empty_lines('one simple line\n'))

    # These "asserts" are used for self-checking and not for an auto-testing
    assert non_empty_lines('one simple line\n') == 1
    assert non_empty_lines('') == 0
    assert non_empty_lines('\nonly one line\n            ') == 1
    assert non_empty_lines('''
Lorem ipsum dolor sit amet,

consectetur adipiscing elit
Nam odio nisi, aliquam
            ''') == 3
    print("Coding complete? Click 'Check' to earn cool rewards!")