From 60bc0d7cf1f0cd9625223dec86539714ec5db77a Mon Sep 17 00:00:00 2001
From: ManaswiniPeddi <manaswinipeddi05@gmail.com>
Date: Tue, 4 Jun 2024 18:49:23 +0530
Subject: [PATCH 1/2] Add files via upload

create task1
---
 Task1.py | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 Task1.py

diff --git a/Task1.py b/Task1.py
new file mode 100644
index 0000000..84caf64
--- /dev/null
+++ b/Task1.py
@@ -0,0 +1,35 @@
+import requests
+def get_weather_data(api_key, city_name):
+    url = f"http://api.openweathermap.org/data/2.5/weather?q={city_name}&appid={api_key}&units=metric"
+    response = requests.get(url)
+    data = response.json()
+    return data
+def display_current_weather(data):
+    print("Current Weather Conditions:")
+    print("---------------------------")
+    print(f"Weather: {data['weather'][0]['description']}")
+    print(f"Temperature: {data['main']['temp']}°C")
+    print(f"Humidity: {data['main']['humidity']}%")
+    print(f"Wind Speed: {data['wind']['speed']} m/s")
+def get_forecast(api_key, city_name):
+    url = f"http://api.openweathermap.org/data/2.5/forecast?q={city_name}&appid={api_key}&units=metric"
+    response = requests.get(url)
+    data = response.json()
+    return data
+def display_forecast(data):
+    print("\nWeather Forecast for the next 5 days:")
+    print("-------------------------------------")
+    for forecast in data['list']:
+        print(f"Date: {forecast['dt_txt']}")
+        print(f"Weather: {forecast['weather'][0]['description']}")
+        print(f"Temperature: {forecast['main']['temp']}°C")
+        print("")
+def main():
+    api_key = 'b73f861c9b47fe465e680a5d330e01eb' 
+    city_name = input("Enter city name: ")   
+    current_weather_data = get_weather_data(api_key, city_name)
+    display_current_weather(current_weather_data)
+    forecast_data = get_forecast(api_key, city_name)
+    display_forecast(forecast_data)
+if __name__ == "__main__":
+    main()
\ No newline at end of file

From 82a3d03947b302e83a7304d926c125942825c9a8 Mon Sep 17 00:00:00 2001
From: ManaswiniPeddi <manaswinipeddi05@gmail.com>
Date: Tue, 4 Jun 2024 21:25:30 +0530
Subject: [PATCH 2/2] Add files via upload

Create Task 3
---
 Task3.py | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 Task3.py

diff --git a/Task3.py b/Task3.py
new file mode 100644
index 0000000..cfb11fe
--- /dev/null
+++ b/Task3.py
@@ -0,0 +1,28 @@
+import nltk
+from nltk.chat.util import Chat, reflections
+
+# Define patterns and responses
+patterns = [
+    (r'hi|hello|hey', ['Hello!', 'Hi there!', 'Hey!']),
+    (r'how are you?', ["I'm doing well, thank you!", "I'm great, thanks for asking!"]),
+    (r'what is your name?', ["I'm just a simple chatbot.", "I'm a chatbot designed to assist you."]),
+    (r'bye|goodbye', ["Goodbye!", "See you later!", "Bye!"]),
+    # Add more patterns and responses as needed
+]
+
+# Create a chatbot
+chatbot = Chat(patterns, reflections)
+
+# Define a function to chat with the user
+def chat():
+    print("Hello! How can I assist you today?")
+    while True:
+        user_input = input("> ")
+        response = chatbot.respond(user_input)
+        print(response)
+        if user_input.lower() == 'bye':
+            break
+
+# Start the chat
+if __name__ == "__main__":
+    chat()
\ No newline at end of file