def shop():
    global dollars
shop = eval(input('Enter something: '))
if shop == 'Shortsword':
    if dollars < 4:
        print("I'm sorry, but you don't have enough dollars to buy that item.")
shop1()
if dollars > 4:
    print('Item purchased!')
dollars -= someNumber
print('You now have ' + dollars + ' dollars.')
UnBoundLocalError: ссылка на локальную переменную перед назначением [счетчик]