Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

BANGLADESH UNIVERSITY OF BUSINESS

AND TECHNOLOGY (BUBT)

Lab Report
On
Lab Experiment
Course Title: Artificial Intelligence & Expert System Lab
Course Code: CSE 352

Submitted to:
Md. Shovon Roy
Lecturer
Department of CSE
Bangladesh University of Business & Technology (BUBT)
Submitted by:
Name: Shabnam Parveen
ID: 15162103050
Intake: 32nd
Section: 02
Program: BSc. Engg. in CSE
Date of Submission: 18 August, 2020
1. Adding 2 Number:
>>> a= 2+3
5

2. Calculating multiple numbers


>>> 5+3-2
6

3. Division:
>>> 10/6
1.6666667

4. Division without fraction


>>> 10//6
1

5. Mod
>>> 10%6
4

6. String
“Hello Python”

7. Get string from user:


>>> input(“Enter your name:”)
Enter your name:

8. Print output
>>> print(“Hello python.”)
Hello python.

9. Printing multiple string


>>> print(“Hello”+” “+”Python.”)
Hello Python.

10. Adding multiple string


>>> “BU”+”BT”
BUBT
>>> “9”+”th”+” semester”
9th semester
>>> 9+”Nine”
error [Integer and string can't be adding]

11. Print output for multiple time


>>> print (“Hello”*5)
Hello Hello Hello Hello Hello

12. Data type converting


>>> int(“12”)
12 [converting string to integer]
>>> int(12.122)
12 [converting float to integer]
>>> float(12)
12.00 [converting integer to float]
>>> str(12)
“12” [converting integer to string]

13. Data assigning


>>> a = 100
>>> a
100
>>> print(a)
100
In python don't need to mention the data type when we assign data in any variable.
Python can automatically identify the data type.

14. Calculating age:


>>> year = int(input(“Enter your Birth year: ”))
Enter your Birth year: 1998
>>> age = 2020-year
>>> print(“You are ”+ str(age) +” years old.”)
You are 22 years old.

You might also like