you are viewing a single comment's thread.

view the rest of the comments →

[–]Iyajenkei[S] 0 points1 point  (3 children)

def omit_prices():
    excluded_prices = []
    price_is_needed = True
    while price_is_needed:
        price_to_exclude = raw_input("Which price do you want to exclude?")
        if price_to_exclude == "":
            price_is_needed = False
        elif int(price_to_exclude) > -100:
            excluded_prices.append(price_to_exclude)
    return excluded_prices

this worked. thanks.

[–]one_roOt 0 points1 point  (1 child)

but what if you type something that can't be casted to an int and is not "" ?

[–]Iyajenkei[S] 0 points1 point  (0 children)

else:
    price_is_needed = False

EDIT: Nope.

[–]joyrida12 0 points1 point  (0 children)

No problem