I'm new to programming and have decided to start with Python following the
advice of experts including Eric S. Raymond.
So far I've learnt quite a lot from this list.

However, I've the following problem.

The program was designed (as part of my practice with Head First
Programming) to check whether an ingredient is Halal or Haram.
I've a simple table online where some ingredients are either halal or
 haram.

For example, if the user enters "water" the program is supposed to tell him
that it's halal;
but it's returning ">" and other characters I don't want to see.

What am I doing wrong?

import urllib.request

page = urllib.request.urlopen("http://halalingredients.theparleyonline.com/
")
text = page.read().decode("utf8")

halal_haram_status = text.find(input("Enter the ingredient:  "))
begin_final_status = halal_haram_status + 3
end_final_status = begin_final_status + 5
status = text[begin_final_status:end_final_status]
print(status)
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to