{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "provenance": [], "authorship_tag": "ABX9TyOXEOuU+2MwSdeSjS6kYtev", "include_colab_link": true }, "kernelspec": { "name": "python3", "display_name": "Python 3" }, "language_info": { "name": "python" } }, "cells": [ { "cell_type": "markdown", "metadata": { "id": "view-in-github", "colab_type": "text" }, "source": [ "\"Open" ] }, { "cell_type": "markdown", "source": [ "# Pick-up Line Generator - Sentimental Analysis\n", "\n", "## Problem Statement\n", "\n", "You are tasked with creating a Python script for a pick-up line generator. The program should generate pick-up lines based on different sentiments such as romantic, funny, cheesy, or flirty.\n", "\n", "### Requirements:\n", "\n", "The script should contain a function generate_pickup_line(sentiment) that takes a sentiment as input and returns a randomly selected pick-up line from the corresponding sentiment category.\n", "The sentiment categories and pick-up lines should be organized in a dictionary or a similar data structure within the script.\n", "The program should allow users to specify the sentiment category for the pick-up line they want to generate.\n", "The script should include a main section where it prompts the user to enter a sentiment category, calls the generate_pickup_line function with the specified sentiment, and prints the generated pick-up line.\n", "\n", "\n", "```\n", "Enter the sentiment category for the pick-up line (romantic/funny/cheesy/flirty): flirty\n", "Generated pick-up line: Are you a magician? Because whenever I look at you, everyone else disappears.\n", "```\n" ], "metadata": { "id": "viG6NBRUzlpg" } }, { "cell_type": "code", "execution_count": 2, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "gAJgWyq9zfyQ", "outputId": "ed1fb610-1301-40f0-f1b8-d2f498012afc" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "You are the reason for my smile.\n" ] } ], "source": [ "import random\n", "\n", "def generate_pickup_line(sentiment):\n", " # Dictionary of pick-up lines categorized by sentiment\n", " pickup_lines = {\n", " \"romantic\": [\n", " \"You are the reason for my smile.\",\n", " \"I never believed in love at first sight until I saw you.\",\n", " \"You must be a shooting star because you light up my life.\",\n", " \"I want to be the reason you look down at your phone and smile.\"\n", " ],\n", " \"funny\": [\n", " \"Do you have a name, or can I call you mine?\",\n", " \"Are you made of copper and tellurium? Because you're Cu-Te.\",\n", " \"If you were a vegetable, you'd be a cute-cumber.\",\n", " \"Do you have a sunburn, or are you always this hot?\"\n", " ],\n", " \"cheesy\": [\n", " \"Do you have a map? I keep getting lost in your eyes.\",\n", " \"Is your name Google? Because you have everything I've been searching for.\",\n", " \"Are you a bank loan? Because you have my interest.\",\n", " \"Do you believe in love at first sight, or should I walk by again?\"\n", " ],\n", " \"flirty\": [\n", " \"Are you a magician? Because whenever I look at you, everyone else disappears.\",\n", " \"Do you have a Band-Aid? Because I just scraped my knee falling for you.\",\n", " \"Are you a camera? Because every time I look at you, I smile.\",\n", " \"If beauty were a crime, you'd be serving a life sentence.\"\n", " ]\n", " }\n", "\n", " # Select a pick-up line based on the specified sentiment\n", " return random.choice(pickup_lines[sentiment])\n", "\n", "if __name__ == \"__main__\":\n", " # Specify the sentiment category\n", " sentiment = \"romantic\" # Change this to \"romantic\", \"funny\", or \"cheesy\" as desired\n", " print(generate_pickup_line(sentiment))\n" ] } ] }