this time I have more code to add to the problem. Our TA wants us to write a function and then print the total number of words in the string, were each word is a group of characters seperated by a space, print the number of <B> tags, and print the number of hyperlinks.
The sample input is:
#statHTML("<B> Article One </B> <a href=http://news.google.com>News</a>")
BUT he wants us to ONLY use WHILE loops. I have finished it but only with FOR loops. Please assist as I cannot get it and even my friends are stuck
This is the code that I have so far.
str1T = len(str1.split())
print (str1T_strat_two)
str_t=str1.count('<B>')
print (str_t)
total = len(str1.split('<B>')) - 1
print (total)
print (str1.count('href'))
Here is a guide to get you going.
You can put whatever code you need in place of the comment.