Challenge 1: Implement an Asynchronous Function
In this challenge, you are required to implement an asynchronous coroutine function.
We'll cover the following
Problem Statement
Implement an asynchronous coroutine function to add two variables and sleep for the duration of the sum. Use the asyncio
loop to call the function with two numbers.
Input
Two number n1 and n2
Output
The sum of two numbers
Sample Input
n1 = 1, n2 = 2
Sample Output
3
Coding Exercise
Write your code below. It is recommended that you try solving the exercise yourself before viewing the solution.
Get hands-on with 1400+ tech skills courses.