二手产品经理

二手产品经理

THIS IS RENO

Learn Python Online in 100 Days - Day 4

Study Log

  1. Today is a comprehensive practice of print and input, and I wrote a code that generates a short story.
  2. It's amazing that colors can be printed in the console. Printing is a bit magical. The printing format is: \033[]m, for example print("\033[31m"). One thing to note: printing colors is a one-time thing, if used in scenarios like highlighting key points. After changing the text to red, it needs to be changed back to white to take effect.

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") 
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.