Docsity

Assignment 1 for AI with python, Assignments of Artificial Intelligence

Toggle sidebar
bg1
Instructions:
Please read the following instructions carefully before submitting this Hands-on Exercise:
• Use MS Word to prepare exercise solution.
• You may consult tutorials and videos if the concept is not clear.
• Your submitted exercise will not be considered/counted if:
▪ It is submitted after due date.
▪ It is not in the required format (.doc or .docx)
▪ It does not open, or file is corrupt.
▪ It is copied (partial or full) from any source (websites, forums, students, etc.)
Learning Outcome:
After completing this exercise, you shall be able to:
• Apply conditional statements in Python to solve real-world problems such as tax calculation
based on different conditions.
• Work with lists and dictionaries to transform data and map values (e.g., creating key-value pairs
from a list).
• Understand and implement basic Object-Oriented Programming (OOP) concepts by designing
classes and building a simple chat system with multiple functionalities.
Hands-on Exercise No. 1
DigiSkills 3.0 Batch-03
AI Using Python
Total Marks: 10
Due Date: 30/04/2026
pf3

Partial preview of the text

Download Assignment 1 for AI with python and more Assignments Artificial Intelligence in PDF only on Docsity!

Instructions: Please read the following instructions carefully before submitting this Hands-on Exercise:

  • Use MS Word to prepare exercise solution.
  • You may consult tutorials and videos if the concept is not clear.
  • Your submitted exercise will not be considered/counted if: ▪ It is submitted after due date. ▪ It is not in the required format (.doc or .docx) ▪ It does not open, or file is corrupt. ▪ It is copied (partial or full) from any source (websites, forums, students, etc.) Learning Outcome: After completing this exercise, you shall be able to:
  • Apply conditional statements in Python to solve real-world problems such as tax calculation based on different conditions.
  • Work with lists and dictionaries to transform data and map values (e.g., creating key-value pairs from a list).
  • Understand and implement basic Object-Oriented Programming (OOP) concepts by designing classes and building a simple chat system with multiple functionalities. Hands-on Exercise No. 1 DigiSkills 3 .0 Batch- 03 AI Using Python Total Marks: 10 Due Date: 30 / 04 /202 6

Problem Statement In this hands-on-exercise, you are required to apply your understanding of basic Python programming, data structures, and Object-Oriented Programming (OOP) to solve practical problems. You will write programs using conditional statements for calculations, work with lists and dictionaries to transform data, and design a simple chat system using classes. The objective is to strengthen your problem-solving skills and understand how different programming concepts are applied together to build real-world applications. You can use any programming environment such as Jupyter Notebook, Google Colab, VS Code, or any other Python editor to write and execute your programs. After completing each of the following given task, take screenshots of your code and its output, and paste them into a single MS Word (.doc/.docx) file as your final solution submission. Tasks:

  1. Write a program that takes salary as input. Using conditional statements, calculate the final tax based on the following rules: (Marks 3) - If the salary is less than 30,000 → Tax rate is 5% - If the salary is between 30,000 and 70,000 → Tax rate is 15% - If the salary is greater than 70,000 → Tax rate is 25%
  2. Given a list of words: words = ["apple", "banana", "kiwi", "cherry", "mango"] (Marks 3) Create a dictionary that maps each word to its corresponding length. Example Output: ({"apple": 5, "banana": 6, "kiwi": 4, "cherry": 6, "mango": 5})
  3. Create a Chat System using Object-Oriented Programming (OOP) concepts. (Marks 4) You need to create the following classes: - User - Message - ChatRoom The system should implement the following functionalities:
  • Sending messages
  • Viewing chat history
  • User joining and leaving the chat room NOTE: Save the code file at your end and only provide Screenshots of each step in MS Word File. BEST OF LUCK ☺