Skip to main content
Commonmark migration
Source Link

#Python 3.6 - 286 241 224 bytes

Python 3.6 - 286 241 224 bytes

def x(L):X,Y=L.split();E,D=' '*11,'_'*12;print(f"""{' '*18}{D} 
(\   ___   /)    /{E} \\
( \ (‘o‘) / )   /    {X+' '*(10-len(X))}\\
({E})  <     {Y}
 (  ‘> <’  )    \{E}   /
    /    \       \{D}/
   /      \ 
  ‘ – “ - ‘""")
Input:
x("Silent Night")
Output:    
                  ____________
(\   ___   /)    /            \
( \ (‘o‘) / )   /    Silent    \
(           )  <     Night
 (  ‘> <’  )    \              /
    /    \       \____________/
   /      \ 
  ‘ – “ - ‘

Note - The version is 3.6 where string literal formatting was introduced. Hence, this won't work in earlier versions.

#Python 3.6 - 286 241 224 bytes

def x(L):X,Y=L.split();E,D=' '*11,'_'*12;print(f"""{' '*18}{D} 
(\   ___   /)    /{E} \\
( \ (‘o‘) / )   /    {X+' '*(10-len(X))}\\
({E})  <     {Y}
 (  ‘> <’  )    \{E}   /
    /    \       \{D}/
   /      \ 
  ‘ – “ - ‘""")
Input:
x("Silent Night")
Output:    
                  ____________
(\   ___   /)    /            \
( \ (‘o‘) / )   /    Silent    \
(           )  <     Night
 (  ‘> <’  )    \              /
    /    \       \____________/
   /      \ 
  ‘ – “ - ‘

Note - The version is 3.6 where string literal formatting was introduced. Hence, this won't work in earlier versions.

Python 3.6 - 286 241 224 bytes

def x(L):X,Y=L.split();E,D=' '*11,'_'*12;print(f"""{' '*18}{D} 
(\   ___   /)    /{E} \\
( \ (‘o‘) / )   /    {X+' '*(10-len(X))}\\
({E})  <     {Y}
 (  ‘> <’  )    \{E}   /
    /    \       \{D}/
   /      \ 
  ‘ – “ - ‘""")
Input:
x("Silent Night")
Output:    
                  ____________
(\   ___   /)    /            \
( \ (‘o‘) / )   /    Silent    \
(           )  <     Night
 (  ‘> <’  )    \              /
    /    \       \____________/
   /      \ 
  ‘ – “ - ‘

Note - The version is 3.6 where string literal formatting was introduced. Hence, this won't work in earlier versions.

changed the input format
Source Link

#Python 3.6 - 286 224241 224 bytes

lambdadef x(L):X,Y:Y=L.split();E,D=' '*11,'_'*12;print(f"""{' '*18}{'_'*12D} 
(\   ___   /)    /{' '*12E} \\
( \ (‘o‘) / )   /    {X+' '*(10-len(X))}\\
({' '*11E})  <     {Y}
 (  ‘> <’  )    \{' '*14E}   /
    /    \       \{'_'*12D}/
   /      \ 
  ‘ – “ - ‘""")

Output:


Input:
x("Silent Night")
Resulting string when 'Silent','Night' is passedOutput: to the function :
                  ____________
(\   ___   /)    /            \
( \ (‘o‘) / )   /    Silent    \
(           )  <     Night
 (  ‘> <’  )    \              /
    /    \       \____________/
   /      \ 
  ‘ – “ - ‘

Note - The version is 3.6 where string literal formatting was introduced. Hence, this won't work in earlier versions.

#Python 3.6 - 286 224 bytes

lambda X,Y:f"""{' '*18}{'_'*12}
(\   ___   /)    /{' '*12}\\
( \ (‘o‘) / )   /    {X+' '*(10-len(X))}\\
({' '*11})  <     {Y}
 (  ‘> <’  )    \{' '*14}/
    /    \       \{'_'*12}/
   /      \ 
  ‘ – “ - ‘"""

Output:

Resulting string when 'Silent','Night' is passed to the function :
                  ____________
(\   ___   /)    /            \
( \ (‘o‘) / )   /    Silent    \
(           )  <     Night
 (  ‘> <’  )    \              /
    /    \       \____________/
   /      \ 
  ‘ – “ - ‘

Note - The version is 3.6 where string literal formatting was introduced. Hence, this won't work in earlier versions.

#Python 3.6 - 286 241 224 bytes

def x(L):X,Y=L.split();E,D=' '*11,'_'*12;print(f"""{' '*18}{D} 
(\   ___   /)    /{E} \\
( \ (‘o‘) / )   /    {X+' '*(10-len(X))}\\
({E})  <     {Y}
 (  ‘> <’  )    \{E}   /
    /    \       \{D}/
   /      \ 
  ‘ – “ - ‘""")

Input:
x("Silent Night")
Output:    
                  ____________
(\   ___   /)    /            \
( \ (‘o‘) / )   /    Silent    \
(           )  <     Night
 (  ‘> <’  )    \              /
    /    \       \____________/
   /      \ 
  ‘ – “ - ‘

Note - The version is 3.6 where string literal formatting was introduced. Hence, this won't work in earlier versions.

fixed typo
Source Link

#Python 3.6 - 286 224 bytes

lambda X,Y:f"""{' '*18}{'_'*12}
(\   ___   /)    /{' '*12}\\
( \ (‘o‘) / )   /    {X+' '*(10-len(X))}\\
({' '*11})  <     {Y}
 (  ‘> <’  )    \{' '*14}/
    /    \       \{'_'*12}/
   /      \ 
  ‘ – “ - ‘"""

Input : s('Mother','Mary')Output:

Resulting string when 'Silent','Night' is passed to the function :
                  ____________
(\   ___   /)    /            \
( \ (‘o‘) / )   /    Silent    \
(           )  <     Night
 (  ‘> <’  )    \              /
    /    \       \____________/
   /      \ 
  ‘ – “ - ‘

Note - The version is 3.6 where string literal formatting was introduced. Hence, this won't work in earlier versions.

#Python 3.6 - 286 224 bytes

lambda X,Y:f"""{' '*18}{'_'*12}
(\   ___   /)    /{' '*12}\\
( \ (‘o‘) / )   /    {X+' '*(10-len(X))}\\
({' '*11})  <     {Y}
 (  ‘> <’  )    \{' '*14}/
    /    \       \{'_'*12}/
   /      \ 
  ‘ – “ - ‘"""

Input : s('Mother','Mary')

Note - The version is 3.6 where string literal formatting was introduced. Hence, this won't work in earlier versions.

#Python 3.6 - 286 224 bytes

lambda X,Y:f"""{' '*18}{'_'*12}
(\   ___   /)    /{' '*12}\\
( \ (‘o‘) / )   /    {X+' '*(10-len(X))}\\
({' '*11})  <     {Y}
 (  ‘> <’  )    \{' '*14}/
    /    \       \{'_'*12}/
   /      \ 
  ‘ – “ - ‘"""

Output:

Resulting string when 'Silent','Night' is passed to the function :
                  ____________
(\   ___   /)    /            \
( \ (‘o‘) / )   /    Silent    \
(           )  <     Night
 (  ‘> <’  )    \              /
    /    \       \____________/
   /      \ 
  ‘ – “ - ‘

Note - The version is 3.6 where string literal formatting was introduced. Hence, this won't work in earlier versions.

removed an extra whitspace
Source Link
Loading
golfed by using lambda
Source Link
Loading
Source Link
Loading