0
0
Agentic_aiml~10 mins

Computer use agents in Agentic Ai - Interactive Code Practice

Choose your learning style8 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a simple agent that prints a greeting.

Agentic_ai
class SimpleAgent:
    def __init__(self, name):
        self.name = name

    def greet(self):
        print([1])
Drag options to blanks, or click blank then click option'
A"Hello, I am " + self.name
BHello, I am agent
Cself.name
Dprint('Hello')
Attempts:
3 left
2fill in blank
medium

Complete the code to make the agent decide an action based on input.

Agentic_ai
def decide_action(input_text):
    if 'hello' in input_text.lower():
        return [1]
    else:
        return 'ignore'
Drag options to blanks, or click blank then click option'
A'responding'
Brespond
C'respond'
D'response'
Attempts:
3 left
3fill in blank
hard

Fix the error in the agent's learning method to update knowledge correctly.

Agentic_ai
class LearningAgent:
    def __init__(self):
        self.knowledge = []

    def learn(self, data):
        self.knowledge.[1](data)
Drag options to blanks, or click blank then click option'
Aappend
Badd
Cextend
Dinsert
Attempts:
3 left
4fill in blank
hard

Fill both blanks to create a dictionary of agent names and their scores above 50.

Agentic_ai
scores = {'agent1': 45, 'agent2': 75, 'agent3': 60}
high_scores = { [1]: [2] for [1], [2] in scores.items() if [2] > 50 }
Drag options to blanks, or click blank then click option'
Aagent
Bscore
Cname
Dscore_value
Attempts:
3 left
5fill in blank
hard

Fill all three blanks to filter and transform agent data into a new dictionary.

Agentic_ai
agents = {'a1': 30, 'a2': 55, 'a3': 70}
filtered_agents = { [1]: [2]*2 for [1] in agents if agents[[3]] > 50 }
Drag options to blanks, or click blank then click option'
Aagent_id
Bagents[agent_id]
Dagent
Attempts:
3 left