# Design a program that prompts the user to enter the names of two primary colors to mix. If # the user enters anything other than red, blue or yellow, the program should display an error # message. Otherwise the program should display the name of the secondary color that results. print('You will be mixing two primary colors to get a resulting color.') print('Primary colors are blue, red and yellow \n') red = 1 blue = 2 yellow = 3 color1 = input('Enter your first primary color: \n') color2 = input('Enter your second primary color: \n') if color1 == 1 and color2 == 2: print('That makes purple!') elif color1 == 2 and color2 == 1: print('That makes purple!') elif color1 == 3 and color2 == 1: print('That makes orange!') elif color1 == 1 and color2 == 3: print('That makes orange!') elif color1 == 2 and color2 == 3: print('That makes green!') elif color1 == 3 and color2 == 2: print('That makes green!') else: print('You did not enter a primary color!')
```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Happy Birthday, Meri Jaan!</title> <style> body { font-family: Arial, sans-serif; text-align: center; } h1 { color: #ff7f0e; } .button { display: inline-block; padding: 10px 20px; background-color: #ff7f0e; color: white; text-decoration: none; border-radius: 5px; margin: 10px; cursor: pointer; } </style> </head> <body> <h1>Happy Birthday, Meri Jaan!</h1> <p>Meri Jaan is turning 23 on June 5th! Let's make it special.</p> <p>Would you like to receive a special link?</p> <button class="button" id="yesButton">Yes</button> <button class="button" id="noButton">No</button> <div id="specialLink" style="display: none;"> <p>Here's your special link: <a href="#">Special Link</a></p> </div> <script> document.getElementById("yesButton").addEventListener("click", function() { document.getElementById("specialLink").style.display = "block"; }); document.getElementById("noButton").addEventListener("click", function() { alert("Okay! Hope you enjoy the celebration anyway!"); }); </script> </body> </html> ``` This code creates a simple webpage wishing "Happy Birthday" to Meri Jaan and providing options to receive a special link with "Yes" and "No" buttons. If the user clicks "Yes," a hidden section containing the special link is displayed, and if they click "No," they receive an alert message.
You will be mixing two primary colors to get a resulting color. Primary colors are blue, red and yellow Enter your first primary color: Enter your second primary color: You did not enter a primary color!