How to get asynchronous value in function python?

  asynchronous, function, python, python-3.x
async def fun():
     return {id:1}


async def fun2():
     var=await fun()
     print(var.id)
     
fun2()

#output : <coroutine object fun2 at 0x7faad2f70640>

I just want to get the id value in fun2, kindly explain me how should i do this

Source: Python Questions

LEAVE A COMMENT