Practice – devcor_350-901

Strength:
0%
Answered: 0 • Correct: 0 • Incorrect: 0

Logged in as Guest

Retry only when the server returns a 5xx status code.

Drag the correct code snippets from the options panel into the placeholders in the code window.

import requests MAX_RETRIES = 3 def get_with_retry(url): for attempt in range(MAX_RETRIES): resp = requests.get(url) if resp.status_code < 500: return resp {{1}} {{2}}

Drag a snippet from the right into each blank box in the code.

Available snippets

continue # retry on 5xx
raise RuntimeError('Server keeps failing')
break
return None