Today's study came earlier than yesterday.
Study Record
- Today is a comprehensive exercise on print and input. I wrote a code that generates a short story.
- It's amazing that colors can be printed in the console using print. The printing format is: \033[]m, for example
print("\033[31m")
. One thing to note: once you print a color, it will remain that way until you change it back to white.
CODE
print("=== Your Adventure Simulator ===")
print("""You'll be asked a bunch of questions
then we'll make you up adn amazing
story with YOU as the star! 🌟""")
print()
name = input("Your name: ")
enemy = input("Your worst enemy's name: ")
superPower = input("Your super power: ")
print()
print("our story begins as our hero name approaches a foreboding castle...")
print("Suddenly a bolt of lightning striked the ground at the feet of", "\033[31m", name, "\033[0m")
print("'Our final battle begins!' shouts the evil", enemy, superPower, "which means they'll win quite easily")