Change 200 to 404. What will the program print?
status = 200
print(status == 200) Line notes
- Store a service response code.
- Compare the code with 200 and print the result.
Question 4 of 5
The helper sends two questions to a remote service. The developer then runs a heavy local calculation and expects the same speedup from async.
If two services each take a second to reply, calling them one at a time means waiting about two seconds. While the first service prepares its reply, Python can send the second request. If that second is spent adding numbers in an ordinary Python loop, there is no network wait to put to use.
WHERE TO START
While one request waits for a response, what else could Python do?
Change 200 to 404. What will the program print?
status = 200
print(status == 200)