title: Python | AsyncIO | TypeError: a coroutine was expected
body: <p>I'm trying python coroutine programming using asyncio. This is my code.</p>
  <pre><code>import asyncio
  
  async def coro_function():
      return 2 + 2
  
  async def get():
      return await coro_function()
  
  print(asyncio.iscoroutinefunction(get))
  
  loop = asyncio.get_event_loop()
  a1 = loop.create_task(get)
  loop.run_until_complete(a1)
  </code></pre>
  <p>But when I execute it, it gives me error</p>
  <pre><code>True
  Traceback (most recent call last):
    File &quot;a.py&quot;, line 13, in &lt;module&gt;
      a1 = loop.create_task(get)
    File &quot;/home/alie/anaconda3/lib/python3.7/asyncio/base_events.py&quot;, line 405, in create_task
      task = tasks.Task(coro, loop=self)
  TypeError: a coroutine was expected, got &lt;function get at 0x7fe1280b6c80&gt;
  </code></pre>
  <p>How to solve it?</p>