How to getting name from Selected_object

I want to get the name of selected object and store it in a variable like how to code in blender 2.8 ?
Look forward to the help. Thanks :pensive:

context.active_object.name

2 Likes