Skip to content

function collapse together in reply in chatbot #81

Closed Answered by rakib86
andrewetm asked this question in Q&A
Discussion options

You must be logged in to vote

try this in the inheaded funtion recall

use this syntex:
def greet(name):
return "Hello, " + name + "!"

def get_weather(city):
return "The weather in " + city + " is sunny."

def get_news():
return "Breaking news: Python chatbots are taking over the world!"

def chatbot():
name = input("What's your name? ")
city = input("Where are you from? ")

reply = greet(name) + "\n" + get_weather(city) + "\n" + get_news()
return reply
print(chatbot())

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by andrewetm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants