A simpler and easier approach would have been: `request.GET.get('langcode', 'en')` - GET is a dictionary like object, you can use .get and provide a default value.