Enkripted
Enkripted

Reputation: 1

Why am i getting a error for putting a if statement in my function

    racks = "1"
racksPerSecond = 0

gameScreenChoice1 = "Traffic Drugs (1) "
gameScreenChoice2 = "Get Slaves (2) "

print("You are NBA Young Boy (Never Broke Again)")

startScreen = input("To start your journey out the trenches press 1: ")

if startScreen == "1":
    print("What do you want to do?")

    waysToGetRacks = input(gameScreenChoice1 + gameScreenChoice2)


def TrafficDrugs(slaveQuestion1):
    (

        slaveQuestion1 == input("   Push P if you want a rack")

        if TrafficDrugs(slaveQuestion1):
            racks += "1"
    )


def getSlaves():
    ()

    if waysToGetRacks == "1":
        TrafficDrugs()
    if waysToGetRacks == "2":
        getSlaves()

Dont ask about the varaibles, but im very confused why im getting a error

Upvotes: 0

Views: 59

Answers (2)

DeadE_019
DeadE_019

Reputation: 1

you can't call a recursive function you have just defined you need to enter a valid parameter in order to pass the if statement.

Upvotes: 0

Boris Borais
Boris Borais

Reputation: 121

You don't need brackets inside your func:

def TrafficDrugs(slaveQuestion1):

        slaveQuestion1 == input("   Push P if you want a rack")

        if TrafficDrugs(slaveQuestion1):
            racks += "1"
    

Upvotes: 1

Related Questions