Is there a simple way to get the key of the dictionary in the dictionary with no error?

Is there a simple way to get the key of the dictionary in the dictionary with no error?

I use this code to get the key of the dictionary in the dictionary with python:

I use this code to get the key of the dictionary in the dictionary with python:

dict_1 = {'name':{'emp':'peter'},"age":34}
name = dict_1.get('name1')
if name is not None:
    emp_name = dict_1.get('name').get('emp_1')
    print(emp_name)

But here is a judgement.In fact,I don't want this judgement,when I remove this judgment, I write it as a line likes this:

dict_1 = {'name':{'emp':'peter'},"age":34}
emp_name = dict_1.get('name_2').get('emp')
print(emp_name)

The error message is:

AttributeError: 'NoneType' object has no attribute 'get

Actually, I just don't want to add if judgment for the beautiful code.

But when I modify my code to a line,an error has occurred.

Is there any way to write the code emp_name = dict_1.get('name_2').get('emp')a line when no key is found, no error occurs?

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Top Python Development Companies | Hire Python Developers

After analyzing clients and market requirements, TopDevelopers has come up with the list of the best Python service providers. These top-rated Python developers are widely appreciated for their professionalism in handling diverse projects. When...

Python GUI Programming Projects using Tkinter and Python 3

Python GUI Programming Projects using Tkinter and Python 3

Guide to Python Programming Language

Guide to Python Programming Language