Ai Lab 2

You might also like

You are on page 1of 1

Lab Session 02:

PRE LAB:

1A) Prateek is working on a project and he is slightly poor in mathematics. The project is based on
performing arithmetic and logical operations with numbers. So help him out by writing a Python
program that considers ‘a’ and ‘b’ as input and gives the result of all arithmetic & logical operations as
output .Use different modules for every operation.

IN LAB:

1 A) Jaswanth is doing a problem in which he has to calculate the LCM and HCF of given numbers. So
help him out by writing a Python code that return LCM and HCF values. Use different modules for both
LCM and HCF.

1 B) Shruthi is assigned to develop a intelligent agent(like a chatterbot) for the addition of two integers
provided the agent must follow some conditions: the agent work will start with reflex to greeting from
user and continues in his state(prime work addition of two numbers) until user provide agent with stop
option.

POST LAB:

1 A) The monthly challenge contest is going on in the code chef, an online coding platform. Ram and his
friends are participating in the contest. It is based on printing complex patterns. In order to complete
that, he must know the logic of Pascal’s triangle. So help him by writing a python code to generate a
Pascal’s triangle by taking a number n as an input and generating Pascal triangle with n+1 lines as
output.

You might also like