repl.it
@pizzapants111/

Festive Christmas Lights

Python

https://codegolf.stackexchange.com/questions/151245/christmas-theme-disclaimer-here/151256#151256

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
import random
d,*l="   _%c_   , [___]   , /:' \   ,|::   |  ,\::.  /  , \::./   ,  '='    ".split(',')
x=int(input())-2
c=['\x1b['+str(random.choice(range(31,38)))+'m'for i in range(x+2)]
print(' '*3,(x+1)*'.--.__.--'+'.\n',d[2:]%'(',(d%'Y')*x,d%')')
[print(c[-2]+s,''.join(c[i]+s for i in range(x)),c[-1]+s,'\x1b[0m')for s in l]