Here's a Python code that prints a heart symbol in full screen before wishing your girlfriend a Happy Valentine's Day:
# Import necessary modulesimport os# Clear the console screenos.system('cls' if os.name == 'nt' else 'clear')# Print heart symbol in full screenprint('\n'.join([''.join([('♥'[(x-y) % len('♥')] if ((x*0.05)**2 + (y*0.1)**2 - 1)**3 - (x*0.05)**2 * (y*0.1)**3 <= 0 else ' ') for x in range(-30, 30)]) for y in range(15, -15, -1)]))# Get girlfriend's namegirlfriend_name = input("Enter your girlfriend's name: ")# Print Valentine's Day messageprint(f"Happy Valentine's Day, {girlfriend_name}!")
In this code, we first import the necessary 'os' module to clear the console screen. We then clear the console screen using the appropriate command for the operating system in use.
Next, we print the heart symbol in full screen using a nested list comprehension that checks each point in a range and prints a heart symbol if the point is inside the equation for a heart shape.
After that, we prompt the user to enter their girlfriend's name using the 'input()' function and store it in a variable called 'girlfriend_name'. Finally, we print out a personalized message using the 'print()' function and include the girlfriend's name using an f-string.
You can customize this code further by adding more messages, adding ASCII art or even sending the message as a text or email to your girlfriend.
I hope this code helps you surprise your girlfriend on Valentine's Day!
