How can I get one value from a @client.command function and implement it into another

suppose you have a command like this

@client.command()
async def test(ctx, arg)
    await ctx.send("the variable is " +  arg)

you can share it by using global variable


argument = ""

@client.command()
async def test(ctx, arg)
    global argument
    argument = arg
    await ctx.send("the variable is " +  arg)

@client.command()
async def anothertest(ctx)
    global argument
    await ctx.send("the previous arg is " +  argument)