KUNAL TIWARI
Saved 10/8/2026, 7:49:30 AM
Open full submission →
Student Showcase
Explore projects created by students in this training cohort.
Saved 10/8/2026, 7:49:30 AM
Open full submission →
Saved 10/8/2026, 5:04:05 AM
marks=input("entre your marks: ")
print(marks)
marksint=int(marks)
grade=""
if marksint<=40:
grade="D"
elif marksint<=60:
grade="C"
elif marksint<=80:
grade="B"
else:
grade="A"
print("your grade is")
print(grade)
Open full submission →
Saved 10/6/2026, 9:31:54 AM
# Write your Python code here
print("hello Everyone")
#input
while True:
marks = input("Enter your marks")
print(marks)
marksInt = int(marks)
grade = ''
if marksInt < 30:
grade = 'C+'
elif marksInt < 45:
grade = 'C'
elif marksInt < 60:
grade = 'B+'
elif marksInt < 75:
grade = 'B'
elif marksInt < 90:
grade = 'A'
else:
grade = 'A+'
print("your grade is")
print(grade)
Open full submission →
Saved 10/6/2026, 2:34:03 AM
#12.
# Write your Python code here
# Simple Multi-Agent System
class ResearchAgent:
def work(self, task):
print("\n[Research Agent]")
print("Researching:", task)
return f"Information collected about {task}"
class AnalysisAgent:
def work(self, information):
print("\n[Analysis Agent]")
print("Analyzing information...")
return f"Analysis completed: {information}"
class WritingAgent:
def work(self, analysis):
print("\n[Writing Agent]")
print("Writing final answer...")
return f"Final Report:\n{analysis}"
class MultiAgentSystem:
def __init__(self):
self.researcher = ResearchAgent()
self.analyzer = AnalysisAgent()
self.writer = WritingAgent()
def run(self, task):
# Agent 1: Research
information = self.researcher.work(task)
# Agent 2: Analysis
analysis = self.analyzer.work(information)
# Agent 3: Writing
final_answer = self.writer.work(analysis)
return final_answer
# Create multi-agent system
system = MultiAgentSystem()
# Give a common goal
result = system.run("Artificial Intelligence")
print("\n====================")
print(result)Open full submission →
Saved 10/5/2026, 2:12:17 PM
# Write your Python code here
# Basic Multi-Agent System
class ResearchAgent:
def work(self, topic):
return f"Research Agent: Collected information about {topic}."
class AnalysisAgent:
def work(self, information):
return f"Analysis Agent: Analyzed the information.\nResult: {information}"
class WritingAgent:
def work(self, analysis):
return f"Writing Agent: Created a final answer.\n{analysis}"
# User gives a topic
topic = input("Enter a topic: ")
# Create agents
researcher = ResearchAgent()
analyst = AnalysisAgent()
writer = WritingAgent()
# Agents work together
research = researcher.work(topic)
print(research)
analysis = analyst.work(research)
print(analysis)
final_answer = writer.work(analysis)
print(final_answer)
Open full submission →
Saved 10/5/2026, 1:53:01 PM
# Write your Python code here
print("Hello, Excelrs!")
Open full submission →
Saved 10/4/2026, 2:38:06 PM
# Write your Python code here
# geade calculator with list
gradeLst =[]
for i in range (5):
marks = int(input("enter your marks"))
print(marks)
marksint =int(marks)
grade = " "
if marksint >= 90:
print ("A")
elif marksint >= 80:
print ("B")
elif marksint >= 70:
print ("C")
elif marksint >= 60:
print ("D")
elif marksint >= 33:
print ("E")
else :
print ("fail")
gradeLst.append (grade)
print(gradeLst)
Open full submission →
Saved 10/4/2026, 9:06:11 AM
# lecture 6 Classes
st1 = {
"name": "Rahul",
"marks": 16,
"division": "A",
"grade": "F"
}
def is_failed(student):
if student["marks"] < 40:
return True
return False
print(is_failed(st1))
class Student:
def __init__(self, name, marks, division, grade):
self.name = name
self.marks = marks
self.division = division
self.grade = grade
def is_failed(self):
if self.marks < 40:
return True
return False
st1 = Student("Rahul", 16, "A", "F")
print(st1.is_failed())
Open full submission →
Saved 10/4/2026, 8:28:10 AM
# Write your Python code here
class ChatGpt_LLM:
def __init__(self, model_name):
self.model_name = model_name
def generateResponse(self, prompt):
# call openai api get response based on the prompt
# openai url
# openai key
# make http call
return "This is a dummy response from " + self.model_name
class Gemini_LLM:
def __init__(self, model_name):
self.model_name = model_name
def generateResponse(self, prompt):
# call gemini api get response based on the prompt
# gemini url
# gemini key
# make http call
return "This is a dummy response from " + self.model_name
class Practo_Tool:
def __init__(self, name):
self.name = name
def useTool(self, input):
# api url
# api key
# http call
print("Using tool " + self.name + " with input " + input)
class Agent:
def __init__(self, name, llm, tool):
self.name = name
self.llm = llm
self.tool = tool
def giveAdvice(self, symptom):
# llm = ChatGpt_LLM("gpt-4")
response = self.llm.generateResponse("Provide advice for the symptom: " + symptom)
print("Advice for " + symptom + ": " + response)
def takeAction(self, input):
self.tool.useTool(input)
def greet():
pass
name = "Hamish"
age = 30
symptomList = [
{
"name": "Cough",
"severity": "mild",
"duration": "2 days",
"priority": 1
},
{
"name": "Fever",
"severity": "high",
"duration": "5 days",
"priority": 2
},
{
"name": "Headache",
"severity": "low",
"duration": "1 day",
"priority": 2
}
]
# print("Hi")
# print(name)
# print(symptomList)
# print(symptomList[0])
# for symptom in symptomList:
# if(symptom["priority"] == 2):
# print(symptom["name"])
# print(symptom["priority"])
symptom = input("Enter symptom: ") # or takeInput()
llm = ChatGpt_LLM("gpt-4")
tool = Practo_Tool("PractoAPI")
agent = Agent("HealthBot1.0", llm, tool)
agent.giveAdvice(symptom)
print("Thank you for using our bot")
Open full submission →
Saved 10/3/2026, 10:20:10 AM
class Student:
def __init__(self, name, marks):
self.name = name
self.marks = marks
self.grade = ""
def calculateGrade(self):
if self.marks <40:
self.grade = "D"
elif self.marks < 60:
self.grade = "C"
elif self.marks < 80:
self.grade = "B"
else:
self.grade = "A"
def displayGrade(self):
print(self.grade)
st1 = Student("St1", 10)
st2 = Student("St2", 75)
st1.calculateGrade()
st1.displayGrade()
st2.calculateGrade()
st2.displayGrade()Open full submission →
Saved 10/3/2026, 8:31:36 AM
# Concept of "CLASS under CLASS"
#Creating another class named"School".
class School:
def __init__(self):
self.students = []
def findTopper(self):
topper = self.students[0]
return topper
def addStudent(self, student):
self.students.append(student)
class Student:
def __init__(self, name, marks):
self.name = name
self.marks = marks
self.grade = ""
def calculateGrade(self):
if self.marks <40:
self.grade = "D"
elif self.marks <60:
self.grade = "C"
elif self.marks <80:
self.grade = "B"
else:
self.grade = "A"
def displayGrade(self):
print(self.name)
print("Grade - ")
print(self.grade)
school1 = School()
for i in range(1):
name = input("Enter Name: ")
marks = int(input("Enter Marks:"))
st = Student(name, marks)
st.calculateGrade()
school1.addStudent(st)
topper = school1.findTopper()
print("Topper is -")
print(topper.name)
Open full submission →
Saved 10/3/2026, 6:25:47 AM
# Write your Python code here
print("Hello, Excelrs!")
def add(x, y):
return x + y
def subtract(x, y):
return x - y
def multiply(x, y):
return x * y
def divide(x, y):
if y == 0:
return "Error! Division by zero."
return x / y
def calculator():
print("Select Operation:")
print("1. Add (+)")
print("2. Subtract (-)")
print("3. Multiply (*)")
print("4. Divide (/)")
while True:
choice = (
input("\nEnter choice (1/2/3/4) or 'q' to quit: ").strip().lower()
)
if choice == "q":
print("Exiting calculator. Goodbye!")
break
if choice in ("1", "2", "3", "4"):
try:
num1 = float(input("Enter first number: "))
num2 = float(input("Enter second number: "))
except ValueError:
print("Invalid input. Please enter numerical values.")
continue
if choice == "1":
print(f"{num1} + {num2} = {add(num1, num2)}")
elif choice == "2":
print(f"{num1} - {num2} = {subtract(num1, num2)}")
elif choice == "3":
print(f"{num1} * {num2} = {multiply(num1, num2)}")
elif choice == "4":
result = divide(num1, num2)
print(f"{num1} / {num2} = {result}")
else:
print("Invalid input. Please choose 1, 2, 3, 4, or 'q'.")
if __name__ == "__main__":
calculator()Open full submission →
Saved 10/3/2026, 6:24:38 AM
# Write your Python code here
print("Hello, Excelrs!")
def add(x, y):
return x + y
def subtract(x, y):
return x - y
def multiply(x, y):
return x * y
def divide(x, y):
if y == 0:
return "Error! Division by zero."
return x / y
def calculator():
print("Select Operation:")
print("1. Add (+)")
print("2. Subtract (-)")
print("3. Multiply (*)")
print("4. Divide (/)")
while True:
choice = (
input("\nEnter choice (1/2/3/4) or 'q' to quit: ").strip().lower()
)
if choice == "q":
print("Exiting calculator. Goodbye!")
break
if choice in ("1", "2", "3", "4"):
try:
num1 = float(input("Enter first number: "))
num2 = float(input("Enter second number: "))
except ValueError:
print("Invalid input. Please enter numerical values.")
continue
if choice == "1":
print(f"{num1} + {num2} = {add(num1, num2)}")
elif choice == "2":
print(f"{num1} - {num2} = {subtract(num1, num2)}")
elif choice == "3":
print(f"{num1} * {num2} = {multiply(num1, num2)}")
elif choice == "4":
result = divide(num1, num2)
print(f"{num1} / {num2} = {result}")
else:
print("Invalid input. Please choose 1, 2, 3, 4, or 'q'.")
if __name__ == "__main__":
calculator()Open full submission →
Saved 10/3/2026, 5:59:36 AM
# Write your Python code here
print("Hello, Excelrs!")
Open full submission →
Saved 10/2/2026, 5:24:09 PM
# Write your Python code here
print("Hello, Excelrs!")
class School:
def __init__(self):
self.students = []
def findTopper(self):
# add logic to find student with highest marks
topper = self.students[0]
return topper
def addStudent(self, student):
self.students.append(student)
class Student:
def __init__(self, name, marks):
self.name = name
self.marks = marks
self.grade = ""
def calculateGrade(self):
if self.marks < 40:
self.grade = "D"
elif self.marks < 60:
self.grade = "C"
elif self.marks < 80:
self.grade = "B"
else:
self.grade = "A"
def displayGrade(self):
print(self.name)
print("Grade - ")
print(self.grade)
school1 = School()
for i in range(1):
name = input("Enter Name: ")
marks = int(input("Enter Marks: "))
st = Student(name, marks)
st.calculateGrade()
school1.addStudent(st)
topper = school1.findTopper()
print("Topper is - ")
print(topper)
Open full submission →
Saved 10/2/2026, 5:10:48 PM
# Write your Python code here
class School:
def __init__(self):
self.students = []
def findTopper(self):
# add logic to find student with highest marks
topper = self.students[0]
return topper
def addStudent(self, student):
self.students.append(student)
class Student:
def __init__(self, name, marks):
self.name = name
self.marks = marks
self.grade = ""
def calculateGrade(self):
if self.marks < 35:
self.grade = "F"
elif self.marks < 65:
self.grade = "C+"
elif self.marks < 85:
self.grade = "B+"
else:
self.grade = "A+"
def displayGrade(self):
print(self.name)
print("Result - ")
print(self.grade)
school1 = School()
for i in range(1):
name = input("Enter Student Name: ")
marks = int(input("Enter Total Marks: "))
st = Student(name, marks)
st.calculateGrade()
school1.addStudent(st)
topper = school1.findTopper()
print("Topper Name is -")
print(topper.name)
Open full submission →
Saved 10/2/2026, 2:22:35 PM
def greet():
print("hi")
print("this is AI Agent Workshop")
def takeInput():
userInput = input("Enter your symptom:")
print(userInput)
return userInput
class Chatgpt_LLM:
def __init__(self,model_name):
self.model_name = model_name
def generateResponse(self, prompt):
return "This is a dummy response from " + self.model_name
class Gemini_LLM:
def __init__(self,model_name):
self.model_name = model_name
def generateResponse(self, prompt):
return "This is a dummy response from " + self.model_name
class Practo_Tool:
def __init__(self, name):
self.name = name
def useTool(self,input):
print("Using tool" + self.name + "woith input" + input)
class Agent:
def __init__(self,name,llm , tool):
self.name = name
self.llm = self.llm
self.tool = tool
def giveAdvice(self,symptom,llm):
response = llm.generateResponse("Provide advice for the symptom:" + symptom)
print("Advice from " + self.name + ":" + response)
def takeAction(self,tool,input):
tool.useTool(input)
def giveAdviceAndTakeAction(self,symptom):
self.giveAdvice(symptom)
self.takeAction(symptom)
greet ()
name = "Ramesh"
age = 30
symptomList =[{
"name":"cough";
"severity":"mild";
"duration":"2 days";
"priority": 1;
},
{
"name":"fever",
"severity":"high",
"duration":"5 days",
"priority": 2
},
{
"name":"headache",
"severity":"low",
"duration":"1 days",
"priority": 3
},
]
Open full submission →
Saved 10/2/2026, 1:29:01 PM
#Class ke Andar Dusre Class ka object
class School:
def __init__(self):
self.Students=[]
def topper(self):
topper = self.Students[0]
return topper
def addStudent(self,Student):
self.Students.append(Student)
class Student:
def __init__(self,name,marks):
self.name=name
self.marks=marks
self.grade=""
def CalculateGrade(self):
if self.marks<40:
self.grade="D"
elif self.marks<60:
self.grade="C"
elif self.marks<80:
self.grade="B"
else:
self.grade="A"
def Display(self):
print(self.name)
print(self.grade)
schl=School()
for i in range(3):
name=input("Enter Your Name : \n ")
marks=int(input("Enter Your marks : \n "))
std1=Student(name ,marks)
std1.CalculateGrade()
schl.addStudent(std1)
topper=schl.topper()
print("Topper is : ")
print(topper.name)
Open full submission →
Saved 10/2/2026, 11:56:05 AM
# Write your Python code here
#print("Hello, Excelrs!")
class student:
def __init__(self,name,marks):
self.name = name
self.marks = marks
self.grade = ""
def calculategrade(self):
if self.marks<40:
self.grade="D"
elif self.marks<60:
self.grade="C"
elif self.marks<80:
self.grade="B"
else:
self.grade="A"
def displaygrade(self):
print(self.grade)
st1 = student("st1",89)
st1.calculategrade()
st1.displaygrade()Open full submission →
Saved 10/2/2026, 6:27:45 AM
def greet():
print("Hi Ramesh")
def takeInput():
s = input("Enter symptom: ")
return s
class ChatGpt_LLM:
def __init__(self, model_name):
self.model_name = model_name
def generateResponse(self, prompt):
return "This is a dummy response from " + self.model_name
class Practo_Tool:
def __init__(self, name):
self.name = name
def useTool(self, data):
print("using tool " + self.name + " with " + data)
class Agent:
def __init__(self, name, llm, tool):
self.name = name
self.llm = llm
self.tool = tool
def giveAdvice(self, symptom):
r = self.llm.generateResponse(symptom)
print("Advice for " + symptom + ": " + r)
def giveAdviceAndTakeAction(self,symptom):
self.giveAdvice(symptom)
self.tool.useTool(symptom)
# MAIN CODE
greet()
symptom = takeInput()
llm = ChatGpt_LLM("gpt-4")
tool = Practo_Tool("Practo")
agent = Agent("HealthBot1.0", llm, tool)
agent.giveAdvice(symptom)
print("Thank you for using out bot")Open full submission →
Saved 10/2/2026, 4:22:50 AM
# Write your Python code here
#Basic agentic
class Gemini_LLM:
def generate response (self,prompt):
#gemini key
#make http call
return "this is aa dummy response from"+self model +name
class practo tool:
def_init_(self,name)
self.name=name
def use tool(self,input):
#api url
#api key
#http call
print("use tool"+self.name+"with input"+input)
class agent:
def_init_(self,name,llm,tool):
self.name=name
self.llm=llm
self.tool=tool
def give advice (self,symptom):
#llm=gemini_llm.generate response("provide advice for the symptom"+symptom)
print("advice for"+symptom+"response")
def take action (self, input):
tool.use tool(input)
def give advice and take action (self,symptom):
self.give advice (symptom)
self.take action (symptom)
greet()
name="Ramesh"
age=30
symptomlist=[{
"name":"cought"
"severity":"mild"
"duration":"2days"
"priority":1
},
{
" name":"fever"
"severity":"high"
"duration":"3days"
"priority":2
}],
symptom=take input ()
llm=gemini_llm("gemini_llm")
agent=agent("health botl.0")
agent.give advice(symptom)
Open full submission →
Saved 10/2/2026, 1:45:12 AM
#dict
gradeList = []
for i in range(3):
name = input("Enter your name")
print(name)
marks = int(input("enter your marks"))
print(marks)
grade = ""
if marks>90:
grade = "A"
elif marks>80:
grade = "B"
elif marks>70:
grade = "C"
elif marks>60:
grade = "D"
elif marks>50:
grade = "pass"
else:
grade = "fail"
print("your marks is : ")
print(grade)
gradeList.append({"name": name, "marks": marks, "grade": grade})
print(gradeList)
Open full submission →
Saved 10/2/2026, 1:14:10 AM
# Write your Python code here
# Simple Multi-Agent System
class ResearchAgent:
def work(self, task):
print("\n[Research Agent]")
print("Researching:", task)
return f"Information collected about {task}"
class AnalysisAgent:
def work(self, information):
print("\n[Analysis Agent]")
print("Analyzing information...")
return f"Analysis completed: {information}"
class WritingAgent:
def work(self, analysis):
print("\n[Writing Agent]")
print("Writing final answer...")
return f"Final Report:\n{analysis}"
class MultiAgentSystem:
def __init__(self):
self.researcher = ResearchAgent()
self.analyzer = AnalysisAgent()
self.writer = WritingAgent()
def run(self, task):
# Agent 1: Research
information = self.researcher.work(task)
# Agent 2: Analysis
analysis = self.analyzer.work(information)
# Agent 3: Writing
final_answer = self.writer.work(analysis)
return final_answer
# Create multi-agent system
system = MultiAgentSystem()
# Give a common goal
result = system.run("Artificial Intelligence")
print("\n====================")
print(result)Open full submission →
Saved 10/1/2026, 7:32:51 PM
# Write your Python code here
#input
gradeList = []
def showTopper():
topper=gradeList[0]
print("Topper")
print(topper)
def showFailed():
failed=gradeList[1]
print("Failed")
print(failed)
for i in range(4):
name =input("Enter your name\n")
print(name)
marks =input("Enter your marks\n")
print(marks)
marksInt = int(marks)
grade = ''
if marksInt < 45:
grade='D'
elif marksInt < 65:
grade='C'
elif marksInt < 80:
grade='B'
else:
grade='A'
print("your grade is ")
print(grade)
gradeList.append({name:name,grade:grade})
print("gradeList")
print(gradeList)
showFailed()Open full submission →
Saved 10/1/2026, 6:54:31 PM
# Write your Python code here
#input
marks = input("Enter your marks")
print(marks)
marksInt = int(marks)
grade = ''
if marksInt < 40:
grade = 'D'
elif marksInt <60:
grade= 'C'
elif marksInt < 80:
grade = 'B'
else:
grade = 'A'
print("your grade is ")
print(grade)
# #output
# print("your r in grade B")
# #variable
# #datatype
# a = 10
# print(a)
Open full submission →
Saved 10/1/2026, 6:36:02 PM
def greet():
print("hi")
print('This is AI Agent Workshop')
def takeInput():
userInput = input("Enter your symptom:")
print(userInput)
return userInput
class ChatGpt_LLM:
def __init__(self, model_name):
self.model_name = model_name
def generateResponse(self, prompt):
return "This is a dummy response from " + self.model_name
class Gemini_LLM:
def __init__(self, model_name):
self.model_name = model_name
def generateResponse(self, prompt):
return "This is a dummy response from " + self.model_name
class Practo_Tool:
def __init__(self, name):
self.name = name
def useTool(self, input):
print("Using tool: " + self.name + " with input " + input)
class Messanger_Tool:
def __init__(self, name):
self.name = name
def useTool(self, input):
print("Using tool: " + self.name + " with input " + input)
class Agent:
def __init__(self, name, llm, tool):
self.name = name
self.llm = llm
self.tool = tool
def giveAdvice(self, symptom):
response = self.llm.generateResponse("Please provide advice for the symptom: " + symptom)
print("Advice for " + symptom + ": " + response)
def takeAction(self, input):
self.tool.useTool(input)
def giveAdviceAndTakeAction(self, symptom):
self.giveAdvice(symptom)
self.takeAction(symptom)
class AutoAgent:
def __init__(self, name, llm, tool, prompt):
self.name = name
self.llm = llm
self.tool = tool
self.prompt = prompt
def decideToUseTool(self, response):
return "severe" in response
def execute(self):
response = self.llm.generateResponse(self.prompt)
print(self.name + " says: " + response)
if self.decideToUseTool(response):
self.tool.useTool(response)
else:
print("No action needed for " + self.name)
chatMessages = []
inquiryAgent = AutoAgent(
"AutoHealthbot",
ChatGpt_LLM("gpt-4"),
Messanger_Tool("MessangerAPI"),
"Ask questions to understand the problem in detail" + "\n".join(chatMessages),
)
inquiryAgent.execute()
advisorAgent = AutoAgent(
"AutoHealthbotGemini",
Gemini_LLM("Gemini-1"),
Practo_Tool("PractoAPI"),
"Provide advice for the problem: " + "\n".join(chatMessages),
)
advisorAgent.execute()
class Manager:
def __init__(self, name, agents):
self.name = name
self.agents = agents
def coordinate(self, symptom):
for agent in self.agents:
agent.execute()
greet()
name = "RAMESH"
age = 30
symptomList = [
{"name": "cough", "severity": "mild", "duration": "2 days", "priority": 1},
{"name": "fever", "severity": "high", "duration": "5 days", "priority": 2},
{"name": "Fever", "severity": "high", "duration": "5 days", "priority": 2},
{"name": "Headache", "severity": "low", "duration": "1 day", "priority": 2},
]
symptom = takeInput()
# Simple agent
llm = ChatGpt_LLM("gpt-4")
tool = Practo_Tool("PractoAPI")
agent = Agent("Healthbot1.0", llm, tool)
agent.giveAdvice(symptom)
print("Thank you for using our bot")Open full submission →
Saved 10/1/2026, 4:45:34 PM
# Write your Python code here
marks = input("Enter your marks")
print(marks)
marksInt = int(marks)
grade = ''
if marksInt < 40:
grade = 'D'
elif marksInt < 60:
grade = 'C'
elif marksInt < 80:
grade = 'B'
else:
grade = 'A'
print("your grade is")
print(grade)Open full submission →
Saved 10/1/2026, 3:38:15 PM
# Write your Python code here
class School:
def __init__(self):
self.students = []
def findTopper(self):
# add logic to find student with highest marks
topper = self.students[0]
return topper
def addStudent(self, student):
self.students.append(student)
class Student:
def __init__(self, name, marks):
self.name = name
self.marks = marks
self.grade = ""
def calculateGrade(self):
if self.marks < 40:
self.grade = "D"
elif self.marks < 60:
self.grade = "C"
elif self.marks < 80:
self.grade = "B"
else:
self.grade = "A"
def displayGrade(self):
print(self.name)
print("Grade - ")
print(self.grade)
school1= School()
for i in range(3):
name = input("Enter Name: ")
marks = int(input("Enter Marks: "))
st = Student(name, marks)
st.calculateGrade()
school1.addStudent(st)
topper = school1.findTopper()
print("Topper is -")
print(topper.name)
Open full submission →
Saved 10/1/2026, 3:34:47 PM
# Write your Python code here
def greet():
print ("Hi")
print ('I am AI Agent ')
def takeInput():
userInput = input("I have : ")
print(userInput)
return userInput
class ChatGtp_LLM:
def __init__(self, model_name):
self.model_name = model_name
def generateResponse(self, prompt):
# call openai api get response based on the prompt
# oprnai url
# oprmai key
# make http call
return "This is a dummy response from " + self.model_name
class Gemini_LLM:
def __init__(self, model_name):
self.model_name = model_name
def generateResponse(self, prompt):
# call Gemini api get response based on the prompt
# Gemini url
# Geminii key
# make http call
return "This is a dummy response from " + self.model_name
class Practo_Tool:
def __init__(self, model_name):
self.model_name = model_name
def useTool(self, input_val):
# api uri
# api key
# http call
print("using tool " + self.model_name + " with input " + input_val)
class Manager_Tool:
def __init__(self, model_name):
self.model_name = model_name
def useTool(self, input_val):
# api uri
# api key
# http call
print("using tool " + self.model_name + " with input " + input_val)
class Agent:
def __init__(self, name, llm, tool):
self.name = name
self.llm = llm
self.tool = tool
def giveAdvice(self, symptom):
# llm = ChatGtp__LLM("gpt-4")
response = self.llm.generateResponse("provide advice for the symptom: " + symptom)
print(response)
def takeAction(self, input_val):
self.tool.useTool(input_val)
def giveAdviceAndTakeAction(self, symptom):
self.giveAdvice(symptom)
self.takeAction(symptom)
class AutoAgent:
def __init__(self, name, llm, tool):
self.name = name
self.llm = llm
self.tool = tool
def decideToUseTool(self, response):
#logic to decide whether to use tool based on response
if "Visit doctor" in response.lower():
return True
return False
def execute(self, symptom):
response = self.llm.generateResponse("Provide advice for the symptom: " + symptom)
print("Advice for " + symptom + ": " + response)
if(self.decideToUseTool(response)):
self.tool.useTool(symptom)
else:
print("No action needed")
class Manager:
def __init__(self, name, agents):
self.name = name
self.agents = agents
def coordinate(self, symptom):
for agent in self.agents:
agent.execute(symptom)
chatMessages = []
inquiryAgent = AutoAgent("AutoHealthBotGemini", Gemini_LLM("gemini-1"), Manager_Tool("MessangerAPI"))
inquiryAgent.execute("Cough")
advisorAgent = AutoAgent("AutoHealthBot", ChatGpt_LLM("gpt-4"), Practo_Tool("PractoAPI"))
advisorAgent.execute("Fever")
greet()
name = "Ankit"
age = 19
symptomList = [{
"name": "cough",
"severity": " mild",
"duration": "2 days",
"priority": 1
},
{
"name": "Fever",
"severity": "high",
"duration": "5 days",
"priority": 2
}, {
"name": "Headache",
"severity": "low",
"duration": "1 day",
"priority": 2
}]
# print("Hi")
# print(name)
# # print(symptomList)
# # print(symptomList{0})
# for symptom in symptomList:
# if(symptom["priority"] == 2):
# print(symptom["name"])
# print(symptom["priority"])
symptom = takeInput()
llm = ChatGtp_LLM("gpt-4")
tool = Practo_Tool("PractoAPI")
agent = Agent("HealthBot1.0", llm, tool)
agent.giveAdvice(symptom)
print("Thank you for using our bot")
Open full submission →
Saved 10/1/2026, 3:06:49 PM
# Write your Python code here
print("Hello, Excelrs!")
text=".language type dynamically is Python "
print (text[::-1])
Open full submission →
Saved 10/1/2026, 2:39:57 PM
# Find factorial of a number
num = int(input("Enter a number: "))
factorial = 1
for i in range(1, num + 1):
factorial = factorial * i
print("Factorial of", num, "is:", factorial)Open full submission →
Saved 10/1/2026, 2:15:32 PM
# Write your Python code here
print("Hello, Excelrs!")
Open full submission →
Saved 10/1/2026, 12:49:48 PM
# Write your Python code here
print("Hello, Excelrs!")
A=25
B=35.4
C="Amit"
A=34
print(A)
print(B)
print(C)Open full submission →
Saved 9/29/2026, 3:55:43 PM
def greet():
print("hi")
print('This is AI Agent Workshop')
def takeInput():
userInput = input("Enter your symptom:")
print(userInput)
return userInput
class ChatGpt_LLM:
def __init__(self, model_name):
self.model_name = model_name
def generateResponse(self, prompt):
return "This is a dummy response from " + self.model_name
class Gemini_LLM:
def __init__(self, model_name):
self.model_name = model_name
def generateResponse(self, prompt):
return "This is a dummy response from " + self.model_name
class Practo_Tool:
def __init__(self, name):
self.name = name
def useTool(self, input):
print("Using tool: " + self.name + " with input " + input)
class Messanger_Tool:
def __init__(self, name):
self.name = name
def useTool(self, input):
print("Using tool: " + self.name + " with input " + input)
class Agent:
def __init__(self, name, llm, tool):
self.name = name
self.llm = llm
self.tool = tool
def giveAdvice(self, symptom):
response = self.llm.generateResponse("Please provide advice for the symptom: " + symptom)
print("Advice for " + symptom + ": " + response)
def takeAction(self, input):
self.tool.useTool(input)
def giveAdviceAndTakeAction(self, symptom):
self.giveAdvice(symptom)
self.takeAction(symptom)
class AutoAgent:
def __init__(self, name, llm, tool, prompt):
self.name = name
self.llm = llm
self.tool = tool
self.prompt = prompt
def decideToUseTool(self, response):
return "severe" in response
def execute(self):
response = self.llm.generateResponse(self.prompt)
print(self.name + " says: " + response)
if self.decideToUseTool(response):
self.tool.useTool(response)
else:
print("No action needed for " + self.name)
chatMessages = []
inquiryAgent = AutoAgent(
"AutoHealthbot",
ChatGpt_LLM("gpt-4"),
Messanger_Tool("MessangerAPI"),
"Ask questions to understand the problem in detail" + "\n".join(chatMessages),
)
inquiryAgent.execute()
advisorAgent = AutoAgent(
"AutoHealthbotGemini",
Gemini_LLM("Gemini-1"),
Practo_Tool("PractoAPI"),
"Provide advice for the problem: " + "\n".join(chatMessages),
)
advisorAgent.execute()
class Manager:
def __init__(self, name, agents):
self.name = name
self.agents = agents
def coordinate(self, symptom):
for agent in self.agents:
agent.execute()
greet()
name = "RAMESH"
age = 30
symptomList = [
{"name": "cough", "severity": "mild", "duration": "2 days", "priority": 1},
{"name": "fever", "severity": "high", "duration": "5 days", "priority": 2},
{"name": "Fever", "severity": "high", "duration": "5 days", "priority": 2},
{"name": "Headache", "severity": "low", "duration": "1 day", "priority": 2},
]
symptom = takeInput()
# Simple agent
llm = ChatGpt_LLM("gpt-4")
tool = Practo_Tool("PractoAPI")
agent = Agent("Healthbot1.0", llm, tool)
agent.giveAdvice(symptom)
print("Thank you for using our bot")Open full submission →
Saved 9/28/2026, 7:57:07 PM
# Write your Python code here
#student = { "Name": "Student1", "grade": 'A'}
#student2 = { "Name": "Student2", "grade": 'B'}
#student3 = { "Name": "Student3", "grade": 'B'}
#print(student)
#print(student["name"])
#print(student["grade"])
#studentList[student, student2, student3]
#print(studentList)
#print(studentList[2])
#print(studentList[2]["name"])
#print(len(student))
gradeList = []
for i in range(3):
#input
name = input("Enter your name\n")
print(name)
marks = int(input("Enter your marks\n"))
print(marks)
#Control Statement
if marks < 40:
grade='D'
elif marks <60:
grade='C'
elif marks<80:
grade='B'
else:
grade='A'
#output
print("Your grade is ")
print(grade)
gradeList.append({name: name, grade:grade})
print(gradeList)
Open full submission →
Saved 9/28/2026, 1:14:55 PM
# Write your Python code here
print("Hello, Excelrs!")
Open full submission →
Saved 9/28/2026, 12:02:03 PM
class school:
def __init__(self):
self.students = []
def find_topper(self):
topper = self.students[0]
return topper
def addStudent(self,student):
self.students.append(student)
class student:
def __init__(self, name, marks):
self.name = name
self.marks = marks
self.grade = ""
def showGrade(self):
if self.marks < 40:
self.grade = 'D'
elif self.marks < 60:
self.grade = 'C'
elif self.marks < 80:
self.grade = 'B'
else:
self.grade = 'A'
def displayGrade(self):
print(self.name, 'your grade is:')
print(self.grade)
sch = school()
for i in range(1):
name = input("Enter your name: ")
marks = int(input("Enter your marks: "))
std = student(name, marks)
std.showGrade()
sch.addStudent(std)
topper = sch.find_topper()
print(topper.name)
print(topper.marks)
topper.displayGrade()
Open full submission →
Saved 9/27/2026, 5:34:06 PM
class School:
def __init__(self):
self.students = []
def findTopper(self):
# add logic to find student with highest marks
topper = self.students[0]
return topper
def addStudent(self, student):
self.students.append(student)
class Student:
def __init__(self, name, marks):
self.name = name
self.marks = marks
self.grade = ""
def calculateGrade(self):
if self.marks < 40:
self.grade = "D"
elif self.marks < 60:
self.grade = "C"
elif self.marks < 80:
self.grade = "B"
else:
self.grade = "A"
def displayGrade(self):
print(self.name)
print("Grade -")
print(self.grade)
school1 = School()
for i in range(1):
name = input("Enter Name: ")
marks = int(input("Enter Marks: "))
st = Student(name, marks)
st.calculateGrade()
school1.addStudent(st)
topper = school1.findTopper()
print("Topper is -")
print(topper.name)
Open full submission →
Saved 9/27/2026, 5:20:48 PM
# Write your Python code here
class Student:
def _init__(self, name, marks):
self.name = name
self.marks = marks
self.grade =
def calculateGrade (self):
if self.marks <40:
self.grade = "D"
elif self.marks < 60:
self.grade = "C"
elif self.marks < 80:
self.grade = "B"
else:
self.grade = "A"
def displayGrade(self):
print(self.grade)
st1 = Student("St1", 10)
st2 = Student("St2", 45)
st1.calculateGrade()
st1.displayGrade()
st2.calculateGrade()
st2.displayGrade()
Open full submission →
Saved 9/27/2026, 2:39:12 PM
# Write your Python code
gradeList=[]
def showTopper():
topper = gradeList[]
print("Topper")
print(topper)
showTopper()
def showFailed():
failed = gradeList[1]
print("Failed")
print(failed)
showFailed()
def getGrade(marks):
grade=""
if marks<40:
grade= "D"
elif marks<60:
grade= "C"
elif marks<80:
grade= "B"
else:
grade="A"
return grade
for i in range(3):
name = input("Enter your name:")
print(name)
marks=int(input("Enter your marks"))
print(marks)
grade = getGrade(marks)
print ("your grade is:")
print(grade)
gradeList.append({name: name, grade: grade})
print("gradeList")
print(gradeList)
showGrade()
Open full submission →
Saved 9/27/2026, 1:54:12 PM
# Write your Python code here
#input
marks = input("Enter your marks")
print(marks)
marksInt = int(marks)
grade = ''
if marksInt <40:
grade ='D'
elif marksInt <60:
grade ='C'
elif marksInt <80:
grade ='B'
else :
grade ='A'
print("your grade is")
print(grade)
# #output
# print("you r in grade b")
# #variable
# #datatype
# a=10 #integer
# print(a)
# b=20
# a=20
# print(a)
# c=10.5 #float
# name = "anubhav" #text
# married = false #boolean
# #operator
# z = a + b
# z = a - b
# z = a * b
# z = a/b
# z = mark < 40
# #contal statement
# if mark < 40;
# ...
# elif mark < 60
# ...
# grade ="A"
# print("your grade is")
# print (grade)
Open full submission →
Saved 9/27/2026, 12:26:27 PM
# Write your Python code here
# Function for cal grade
def getGrade(mark):
grade = ''
if mark > 90:
grade = 'A+'
elif mark > 80:
grade = 'A'
elif mark > 60:
grade = 'B'
elif mark > 35:
grade = 'C'
else:
grade = 'fail'
print(f'\nYour name:- {name}')
print(f'Your grade:- {grade}')
st_names_grades.append({name:grade})
def showTopper():
topper = st_names_grades[0]
print(topper)
def showfail():
fail = st_names_grades[1]
print(fail)
print("Using of functions!")
st_names_grades = [] # init empty
for i in range(2):
name = input('Enter the name: ')
mark = int(input('\nEnter the mark: '))
getGrade(mark) # calling the function
showTopper()
showfail()
Open full submission →
Saved 9/27/2026, 8:21:00 AM
# Write your Python code here
class Studnet:
def __init__(self, name, marks):
self.name = name
self.marks = marks
self.grade = ""
def calculateGrade(self):
if self.marks <40:
self.grade = "D"
elif self.marks < 60:
self.grade = "C"
elif self.marks < 80:
self.grade = "B"
else:
self.grade = "A"
def displayGrade(self):
print(self.name)
print("Grade - ")
print(self.grade)
students = []
for i in range(3):
name = input("Enter name: ")
marks = int(input("Enter Marks: "))
st = Studnet(name, marks)
st.calculateGrade()
students.append(st)
for i in range(3):
studnet[i].displayGrade()
Open full submission →
Saved 9/27/2026, 7:55:24 AM
# Write your Python code here
print("Hello, Excelrs!")
gradelist[]
for i in range(4):
print("Hello, Excelrs!")
marks=int(input("enter your marks"))
print(marks)
grade=''
if(marks>90):
grade='A'
elif(marks>80):
grade='B'
elif(marks>60):
grade='C'
elif(marks>40):
grade='D'
else:
grade='E'
print("your grade is:", grade)
gradelist append{grade}
print(gradelist)Open full submission →
Saved 9/27/2026, 5:23:43 AM
class Student:
def __init__(self, name, marks):
self.name = name
self.marks = marks
self.grade = ""
def calculateGrade(self):
if self.marks < 40:
self.grade = "D"
elif self.marks < 60:
self.grade = "C"
elif self.marks < 80:
self.grade = "B"
else:
self.grade = "A"
def displayGrade(self):
print(self.grade)
st1 = Student("St1", 10)
st2 = Student("St2", 45)
st1.calculateGrade()
st1.displayGrade()
st2.calculateGrade()
st2.displayGrade()Open full submission →
Saved 9/26/2026, 5:27:35 PM
# Write your Python code here
for i in range(4):
marks = input("Enter your marks: ")
print(marks)
marksInt = int(marks)
grade = ''
if marksInt < 40:
grade = 'D'
elif marksInt < 60:
grade = 'C'
elif marksInt < 80:
grade = 'B'
else:
grade = 'A'
print("Your grade is:")
print(grade)
Open full submission →
Saved 9/26/2026, 4:26:36 PM
# Write your Python code here
#input
gradeList = []
st1 = (
name: "st1"
div: "B"
)
class students:
name,
marks,
div
grade
def isFailed():
return marks < 40
def beh1():
def beh2():
st1 = Student("st1", 16, 'A', ...)
st1.isFailed()
st2 = Student("st1", 16, 'A', ...)
st3 = Student("st1", 16, 'A', ...)
st4 = Student("st1", 16, 'A', ...)
def showTopper():
topper = gradeList[0]
print(topper)
def showFailed():
failed = gradeList[1]
print(failed)
def is failed(st1):
return st1["marks"] < 40
def findGrade(marksInt):
grade = ""
if marksInt < 40:
grade = "D"
elif marksInt < 60:
grade = "C"
elif marksInt < 80:
grade = "B"
else:
grade = "A"
return grade
for i in range(3):
name = input("Enter your name\n")
print(name)
marks = input("Enter your marks\n")
print(marks)
marksInt = int(marks)
grade = getGrade(marksInt)
print("your grade is ")
print(grade)
gradeList.append({
name: name,
"grade": grade,
"marks": marks
})
print(gradeList)
showFailed()
Open full submission →
Saved 9/26/2026, 1:55:55 PM
# Write your Python code here
print("Hello, Excelrs!")
Open full submission →
Saved 9/26/2026, 1:29:14 PM
# Write your Python code here
#input
gradelist = []
for i in range(3):
name = input("Enter your name\n")
print(name)
marks = input("Enter your marks\n")
print(marks)
marksInt = int(marks)
grade = ''
if marksInt < 40:
grade = 'D'
elif marksInt < 60:
grade = 'C'
elif marksInt < 80:
grade = 'B'
else:
grade = 'A'
print("your grade is")
print(grade)
gradelist.append({ name: name, grade: grade })
print(gradelist)
Open full submission →
Saved 9/26/2026, 7:49:34 AM
# Write your Python code here
for i in range (10):
print("Hello,Excelrs!")
print("How r u !")
print("hii")
print("done")
Open full submission →
Saved 9/26/2026, 3:46:22 AM
#input
class Student:
def __init__(self, name, marks, school):
self.name = name
self.marks = marks
self.school = school
self.grade = self.get_grade()
def get_grade(self):
if self.marks >= 80:
return "A"
elif self.marks >= 60:
return "B"
elif self.marks >= 40:
return "C"
else:
return "D"
students = []
for i in range(3):
name = input("Enter student name: ")
marks = int(input("Enter marks: "))
school = input("Enter school name: ")
student = Student(name, marks, school)
students.append(student)
print("\n--- Student Details ---")
for student in students:
print("Name:", student.name)
print("Marks:", student.marks)
print("Grade:", student.grade)
print("School:", student.school)
print()
topper = max(students, key=lambda student: student.marks)
print("--- Topper ---")
print("Name:", topper.name)
print("Marks:", topper.marks)
print("School:", topper.school)
Open full submission →
Saved 9/26/2026, 2:48:51 AM
# Write your Python code here
print("Hello, Excelrs!")
input("Enter your marks")
print("you r grade p")
a=10
b=20
c=30
d=40
Open full submission →
Saved 9/25/2026, 6:18:22 PM
class Student:
def __init__(self, name, marks):
self.name = name
self.marks = marks
seld.grade = ""
def calculateGrade(self):
if self.marks < 40:
self.grade = "D"
elif self.marks < 60:
self.grade = "C"
else:
self.grade = "A"
def displayGrade(self):
print(self.name)
print("Grade - ")
print(self.grade)
class School:
def __init__(self):
self.students = []
def addStudent(self, student):
self.students.append(students)
def findTopper(seld):
if not self.students:
return None
topper = self.student[0]
for student in self.students:
if student.marks > topper.marks:
topper = student
return topper
school1 = School()
s1 = Student("Aman", 75)
s1.calculateGrade()
s2 = Student("Rahul", 92)
s2.calculateGrade()
s3 = student("Priya", 68)
s3.calculateGrade()
school1.addStudent(s1)
school1.addStudent(s2)
school1.addStudent(s3)
topper = school.findTopper()
print( "Topper is -")
print(topper.name)
print(topper.name)
print("Marks:", topper.marks)
topper.displayGrade()Open full submission →
Saved 9/25/2026, 5:13:25 PM
# video 9
class School:
def __init__(self):
self.students = []
def findTopper(self):
# add logic to find student with highest marks
topper = self.students[0]
return topper
def addStudent(self, student):
self.students.append(student)
class Student:
def __init__(self,name,marks):
self.name = name
self.marks = marks
self.grade = ""
def calculateGrade(self):
if self.marks <40:
self.grade = "D"
elif self.marks < 60:
self.grade = "C"
elif self.marks < 80:
self.grade = "B"
else:
self.grade = "A"
def displayGrade(self):
print(self.name)
print("Grade - ")
print(self.grade)
school1 = School()
for i in range(1):
name = input("Enter Name: ")
marks = int(input("Enter Marks: "))
st = Student(name, marks)
st.calculateGrade()
school1.addStudent(st)
topper = school1.findTopper()
print("Topper is -")
print(topper.name)
Open full submission →
Saved 9/25/2026, 2:50:21 PM
#Grade Calculater
print("Welcome to Grade Calculator")
marks = int(input("enter your marks : "))
print("")
if marks>100:
print("Mistake in marks calculating !!")
else:
if marks<32:
print("Your grade is F ")
elif marks>=32 and marks<50:
print("Your grade is D")
elif marks>=50 and marks<75:
print("Your grade is C")
elif marks>=75 and marks<85:
print("Your grade is B")
elif marks>=85 and marks<95:
print("Your grade is A")
elif marks>=95 and marks<=100:
print("Your grade is A+")Open full submission →
Saved 9/25/2026, 2:35:33 PM
# Write your Python code here
marks=float(input(' your marks '))
print(marks)
totalmarks=float(input(' total marks '))
print(totalmarks)
percentage=(marks/totalmarks)*100
print('your percentage')
print( percentage)
grade = ""
if percentage < 40:
grade = "D"
elif percentage < 60:
grade = "C"
elif percentage < 80:
grade = "B"
else:
grade = "A"
print('your grade')
print(grade)
Open full submission →
Saved 9/25/2026, 6:01:38 AM
# Write your Python code here
total = 0
count = 0
while True:
grade = float(input("Enter a grade (or -1 to finish): "))
if grade == -1:
break
total += grade
count += 1
if count > 0:
average = total / count
print(f"Average grade: {average:.2f}")
if marks >= 90:
letter = "A"
elif marks >= 80:
letter = "B"
elif marks >= 70:
letter = "C"
elif marks >= 60:
letter = "D"
else:
letter = "F"
print(f"Letter grade: {letter}")
else:
print("No grades were entered.")
Open full submission →
Saved 9/24/2026, 5:13:32 PM
# Write your Python code here
#adding while loop in our grade calculator
# let i=the number of students
i=0
while i<5:
marks = int(input("Enter your marks : "))
if(marks<40):
print("your grade id 'C'")
elif(marks<60):
print("your grade is 'B'")
elif(marks<80):
print("your grade is 'A'")
else:
print("your grade is 'A+'")
i+=1
print("done for all students")
#i have done this for 5 students only..if i have to change the number of students whose i have to check their grade , just change the value of iOpen full submission →
Saved 9/24/2026, 12:35:14 PM
# Write your Python code here
i = 0
while i<3;
input ("What your name")
print("Hello, Excelrs!")
i+i+i
print("Done")
Open full submission →
Saved 9/24/2026, 12:08:11 PM
# Write your Python code here
print("Hello, Excelrs!")
Open full submission →
Saved 9/24/2026, 7:37:40 AM
# Write your Python code here
print("Hello, Excelrs!")
Open full submission →
Saved 9/24/2026, 5:31:46 AM
# Write your Python code here
def showTopper():
topper = gradeList[0]
print("Topper")
print(topper)
def showFailed():
failed = gradeList[1]
print("Failed")
print(failed)
def gradecalculate(marks):
if marks < 40:
grade = 'D'
elif marks < 60:
grade = 'C'
elif marks < 80:
grade = 'B'
else:
grade = 'A'
return grade
gradeList = []
for i in range(2):
name = input("Enter your name \n")
print(name)
marks = int(input("Enter Your marks: \n"))
print(marks)
grade = gradecalculate(marks)
print(f"Your grade is {grade}\n")
gradeList.append({"name":name,"Grade":grade})
print(gradeList)
showTopper()
Open full submission →
Saved 9/23/2026, 2:48:56 PM
# Write your Python code here
for i in range(1, 6):
marks = int(input("enter your marks: "))
if(marks<=100 and marks>=90):
grade = "Ex"
elif(marks<90 and marks>=80) :
grade = "A"
elif(marks<80 and marks>=70) :
grade = "B"
elif(marks<70 and marks>=60) :
grade = "C"
elif(marks<60 and marks>=50) :
grade = "D"
elif(marks<50 ) :
grade = "F"
print("your grade is : ", grade)
Open full submission →
Saved 9/23/2026, 2:41:38 PM
Marks=int(input("Enter your marks"))
print(Marks)
Grade=''
if Marksint<40;
Grade="D"
else if Marksint<60;
Grade="C"
else if Marksint<80;
Grade="B"
else;
Grade="A"
print("Your Grade is ")
print(Grade)
Open full submission →
Saved 9/23/2026, 12:46:16 PM
# Write your Python code here
print("Hello, Excelrs!")
Open full submission →
Saved 9/23/2026, 3:08:57 AM
# Write your Python code here
print("Hello, Excelrs!")
print("==============================")
print(" SIMPLE CALCULATOR")
print("==============================")
num1 = 266387
num2 = 17362
print("पहला नंबर =", num1)
print("दूसरा नंबर =", num2)
print("\nAddition =", num1 + num2)
print("Subtraction =", num1 - num2)
print("Multiplication =", num1 * num2)
print("Division =", num1 / num2)
print("==============================")
print(" CALCULATION END")
print("==============================")Open full submission →
Saved 9/22/2026, 8:48:33 PM
import random
number = random.randint(1,100)
while True:
guess = int(input("Guess the number (1-100):"))
if guess == number:
print ("Aap ko milte hai 7 crore congratulations!")
break
elif guess < number:
print("Too low! Try again.")
else:
print("Too high! Try again.")
Open full submission →