Question: WAP to convert the string "MARY JEORGE WOODS" a full name into 'WOODS m. j.' as output 
i.e. 1st name and ,middle name's 1st alphabet only with full surname

my program is not running and giving expected ouput.

Answer: 
```
full_name="MARY JEORGE WOODS"
list_name=full_name.split()
if list_name[2]: res=list_name[2]+' '+ list_name[0][0].lower()+'.'+list_name[1][0].lower()+'.'
else :
    res=list_name[1]+' '+ list_name[0][0].lower()+'.'

```
```
full_name="MARY JEORGE WOODS"
list_name=full_name.split()
if(list_name.Length == 3)
    res=list_name[2]+' '+ list_name[0][0].lower()+'.'+list_name[1][0].lower()+'.'
if(list_name.Length == 2)
    res=list_name[1]+' '+list_name[1][0].lower()+'.'
if(list_name.Length == 1)
    res=list_name[0]
else
    res = "";

```