Quantcast
Channel: Active questions tagged feed - Stack Overflow
Viewing all articles
Browse latest Browse all 542

what's the use of feed(input()) in Python?

$
0
0
from HTMLParser import HTMLParserclass MyHTMLParser(HTMLParser):    def handle_starttag(self, tag, attrs):        print ('Start :', tag)        for ele in attrs:            print ('->', ele[0], '>', ele[1])    def handle_endtag(self, tag):        print ('End   :', tag)    def handle_startendtag(self, tag, attrs):        print ('Empty :', tag)        for ele in attrs:            print ('->', ele[0], '>', ele[1])parser = MyHTMLParser()for _ in range(int(input())):    parser.feed(input())

What's the use of the last line "parser.feed(input())"? what are the other ways that it can be used

The image of the code


Viewing all articles
Browse latest Browse all 542

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>