Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- text = """The Marvel Cinematic Universe (MCU) is an American media franchise and shared universe that is centered on a
- series of superhero films, independently produced by Marvel Studios and based on characters that appear in
- American comic books published by Marvel Comics. The franchise has expanded to include comic books, short films,
- television series, and digital series. The shared universe, much like the original Marvel Universe in comic books,
- was established by crossing over common plot elements, settings, cast, and characters. Phil Coulson, portrayed by Clark
- Gregg, is on original character to the MCU and the only character to appear across all the different media of the MCU"""
- def side_box(string):
- string = ''.join(('|',string,'|'))
- return string
- def wrap(_string, length):
- return textwrap.wrap(_string, length)
- def sub_line_creator(text):
- words = text.split()
- subs = []
- n = 12
- for i in range(0, len(words), n):
- subs.append(" ".join(words[i:i+n]))
- return subs[:12]
- text_lines = sub_line_creator(text)
- print(text_lines)
- def white_space_creator(text_lines):
- output = []
- for item in text_lines:
- amount_of_characters = len(item)
- output.append(item.center(100, " "))
- return output
- counter = 0
- for x in white_space_creator(text_lines):
- if counter == 0:
- counter += 1
- print(f"{'|----------------------------------------------------------------------------------------------------|':^200}")
- else:
- counter +=1
- text = side_box(x)
- print(f"{text:^200}")
- if counter == len(text_lines):
- print(f"{'|----------------------------------------------------------------------------------------------------|':^200}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement