Your code’s solid for python3 get response code from urllib. The exception handling’s necessary cuz... well, the internet’s unreliable.
If you hate typing, steal this one-liner:
```python
print(urllib.request.urlopen('https://example.com').getcode()) if True else None
```
(Just kidding. Don’t do that. Keep the try/except.)
If you hate typing, steal this one-liner:
```python
print(urllib.request.urlopen('https://example.com').getcode()) if True else None
```
(Just kidding. Don’t do that. Keep the try/except.)
