Having issues with if, else statements python

When dealing with user input. It’s always a best to strip out extra white space. And when doing string comparisons to always bring things to lower or upper case. So start with

answer = raw_input("Will You Make Me Food?:").strip().lower()

Then

if answer == "yes":
    print attribute 
elif answer == "no":
    print "Your the Worst" 
else:
    print "Invalid Answer"

having done that, examine your for loop. You are executing the above code twice. for answer in range(2): but you are gathering input only once. Did yoyu perhaps mean

for answer in range(2):
    answer = raw_input("Will You Make Me Food?:").strip().lower()

    if answer == "yes":
        print attribute 
    elif answer == "no":
        print "Your the Worst" 
    else:
        print "Invalid Answer"

Addendum:
Regarding your problem about printing attribute in order. This is a dictionary, so it will not be saved in the same order that you define it. For that you can use tuples instead

attribute = [(    "G", "Greatest"),("O": "Of"), ... ) 

Leave a Comment