二手产品经理

二手产品经理

THIS IS RENO

Learn Python Online in 100 Days - Day 4

Today's study came earlier than yesterday.

Study Record

  1. Today is a comprehensive exercise on print and input. I wrote a code that generates a short story.
  2. 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") 
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.