File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ # Let us assume this CONFIG holds some sensitive information 
2+ CONFIG  =  {
3+     "KEY" : "ASXFYFGK78989" 
4+ }
5+ 
6+ 
7+ class  PeopleInfo :
8+     def  __init__ (self , fname , lname ):
9+         self .fname  =  fname 
10+         self .lname  =  lname 
11+ 
12+ 
13+ def  get_name_for_avatar (avatar_str , people_obj ):
14+     return  avatar_str .format (people_obj = people_obj )
15+ 
16+ 
17+ # Driver Code 
18+ people  =  PeopleInfo ('GEEKS' , 'FORGEEKS' )
19+ 
20+ # case 1: st obtained from user 
21+ # st = input() 
22+ # get_name_for_avatar(st, people_obj = people) 
23+ # enter: Avatar_{people_obj.fname}_{people_obj.lname} 
24+ # case 2: st obtained from user 
25+ st  =  input ()
26+ result = get_name_for_avatar (st , people_obj = people )
27+ print (result )
28+ # enter {people_obj.__init__.__globals__[CONFIG][KEY]} 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments