2

Python 3.9 How i get returned value from async function !


import asyncio


async def test(asd: bool):
    if asd is True:
        print("true")
        return True
    else:
        print("not true")
        return False

# simple function return
res = test(asd=0)    
print(f"{res=}, {type(res)=}")
1
  • 2
    my_response = asyncio.run(test(asd)) Commented Apr 23, 2022 at 8:57

1 Answer 1

0

Change p.rint to print. You send 0 asd = 0 its false then test return false and print "not true".

Sign up to request clarification or add additional context in comments.

1 Comment

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.