I'm not sure what this means...
TypeError: 'NoneType' object is not iterable
here's the code

day, season, help4, myGame  = karidInn(day, season, help4, myGame)

that's where are call the def function

def karidInn(day, season, help4, localGame):
    if chooseLocation == "13":
        print chooseLocation
        while help4 == 2:
            print 'Welcome back to the best Inn in Karid'
            time.sleep(1)
            print 'we just finished renovaction'
            time.sleep(1)
            print 'and have four more types of ROOMS!!!!'
            time.sleep(1)
            print '1. basic room'
            time.sleep(1)
            print '2. deluxe room'
            time.sleep(1)
            print '3. luxure room'
            time.sleep(1)
            print '4. defitity room of luxury'
            time.sleep(1)
            print '5. cheap cheap room'
            time.sleep(1)
            print '6. exit'
            'which would you like'
            chooseRoom = raw_input()
            if chooseRoom == "1 des":
                print 'a basic room for travellers'
                time.sleep(1)
                print 'recovers 25% of total health and mana'
                time.sleep(1)
                print 'costs 100 gold pieces'
            elif chooseRoom == "2 des":
                print 'a deluxe room for merchants and sales men'
                time.sleep(1)
                print 'recovers 50% of total health and mana and 25% of energy'
                time.sleep(1)
                print 'costs 200 gold pieces'
            elif chooseRoom == "3 des":
                print 'a luxurious room fit with silver furniture'
                time.sleep(1)
                print 'recovers 75% of total health and mana and 25% of energy'
                time.sleep(1)
                print 'costs 300 gold pieces'
            elif chooseRoom == "4 des":
                print 'a room fit for a king'
                time.sleep(1)
                print 'recovers all health and mana and 25% of energy'
                time.sleep(1)
                print '300 gold pieces'
            elif chooseRoom == "5 des":
                print 'a room for a pauper'
                time.sleep(1)
                print 'costs 0 gold pieces DX'
            elif chooseRoom == "6":
                break
            elif chooseRoom == "1":
                if gold > 100:
                    gold -= 100
                    hpRecover = localGame.maxYourHp * 0.25
                    localGame.yourHp = localGame.yourHp + hpRecover
                    getMaxHp(localGame.yourHp)
                    manaRecover = localGame.maxYourMana * 0.25
                    localGame.yourMana = localGame.yourMana + manaRecover
                    localGame.yourMana = getMaxMana(localGame.yourMana, localGame.maxYourMana)
                    season, day = gettingTime(day,season)
                    date, day, season = getDate(day, season)
                    print date
                    return day, season, help4, localGame
                    break
                if gold < 100:
                    print 'please have enough gold before purchase'

        else:
            print 'would you like to sleep and rest for the night?'
            print '1. yes'
            print '2. no'
            rest = raw_input()

            if rest == "1":

				season, day = gettingTime(day,season)
				date, day, season = getDate(day, season)
				print 'the date is now ' + date
				help4 += 1

				return day, season,help4, localGame

here's the actually def code
PLEASE HELP

Recommended Answers

All 2 Replies

I suspect that your function returned None. Try to call it this way

value  = karidInn(day, season, help4, myGame)
if value is None:
    print("GRRRRRRRRRRRRRRRRRR")
else:
    day, season, help4, myGame = value

oh I never knew that!!
Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.