232k views
2 votes
Assignment 3: Chatbox python coding

I just need something real simple that follows the criteria in simple coding

Assignment 3: Chatbox python coding I just need something real simple that follows-example-1
User Mmackh
by
5.3k points

1 Answer

5 votes

In python:

import random

good_responses = (["That's cool!", "Wow!", "That's great to hear!", "Tell me more"])

bad_responses = (["I'm sorry", "That sucks!"])

first_name = input("What's your first name? ")

last_name = input("What's your last name? ")

print(f"Hello {first_name} {last_name}, nice to meet you!")

age = int(input(f"How old are you, {first_name}? "))

if age > 17:

print("Wow, you're old enough to vote!")

else:

print("Quite young, aren't you.")

color = input("What's your favorite color? ")

print(good_responses[random.randint(0, 3)])

feeling = input("How are you feeling? (sad/happy) ")

if feeling == 'sad':

print(bad_responses[random.randint(0, 1)])

else:

print(good_responses[random.randint(0, 3)])

print(f"It's been nice chatting with you, {first_name}!")

I hope this helps!

User Richard Irons
by
4.8k points