You are on page 1of 4

Foundations of AI Applications Lab

HOME TASK
EXPERIMENT – 1
Task-1:
WAP to print any ASCII Art from the website
http://www.chris.com/ascii/
Theory:
In python string can be represented in two ways:
1. Single line strings which is represented in single quote or double quote(‘strings’ or
‘’strings’’).
2. Multi line strings which is represented by three times of double or single
quote(‘’’strings‘’’).
Requirements:
Python IDE
Code:

Outcome:
Foundations of AI Applications Lab

Task-2:
WAP to print (in the middle of the screen) your Name, UID and Section as listed below using
only one print statement.
FirstName “LastName”
UID
Section
Theory:
shutil.get_terminal_size can be used to get the terminal size and center can be used to center
align the strings with a terminal size as one of the required parameter.
Requirements:
Python IDE
Code:
Foundations of AI Applications Lab

Outcome:

Task-3:
Write a Personal Greeter Program
The Personal Greeter program adds a single, but very cool, element to the Greeter program:
user input. Instead of working with a predefined value, the computer lets the user enter his or
her name and then uses it to say hi.

Theory:
User can input their name using input function and print using print function.
Example:
Name = input(“Enter your Name”) # Name variable declaration
print(“Your name is”, Name) #Print the string stored in Name variable
Foundations of AI Applications Lab

Requirements:
Python IDE
Code:

Outcome:

You might also like