-
function collapse together in reply in chatbot,codecademy project 2 |
Beta Was this translation helpful? Give feedback.
Answered by
rakib86
Mar 31, 2023
Replies: 1 comment
-
try this in the inheaded funtion recall use this syntex: def get_weather(city): def get_news(): def chatbot(): reply = greet(name) + "\n" + get_weather(city) + "\n" + get_news() |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
andrewetm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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())