0% found this document useful (0 votes)
10 views

simonePart B Format

The document is a lab manual for the Basics of Python course at SVKM’s NMIMS University, detailing an experiment conducted by a student named Simone Goyal. It includes various Python code tasks, input/output examples, and figures illustrating the results of the tasks. The conclusion emphasizes the learning of operands in Python and their usage.

Uploaded by

Topchefoframen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

simonePart B Format

The document is a lab manual for the Basics of Python course at SVKM’s NMIMS University, detailing an experiment conducted by a student named Simone Goyal. It includes various Python code tasks, input/output examples, and figures illustrating the results of the tasks. The conclusion emphasizes the learning of operands in Python and their usage.

Uploaded by

Topchefoframen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

SVKM’s NMIMS University

Mukesh Patel School of Technology Management & Engineering


COURSE: Basics of Python Lab Manual
BTI Sem IV Academic Year 2024-2025

Experiment - 1
PART B

(PART B: TO BE COMPLETED BY STUDENTS)

(Students must submit the soft copy as per following segments within two hours of the
practical. The soft copy must be uploaded on the Teams or emailed to the concerned lab
in charge faculties at the end of the practical in case the there is no Black board access
available)

Roll No. C168 Name: Simone Goyal

Program: BTI Computer Division: D

Semester: 4 Batch: D2

Date of Experiment: 16/1/25 Date of Submission:16/1/25

Grade:

1
SVKM’s NMIMS University
Mukesh Patel School of Technology Management & Engineering
COURSE: Basics of Python Lab Manual
BTI Sem IV Academic Year 2024-2025

B.1. Software Code written by student:

https://colab.research.google.com/drive/1GOUV20YVbrsi_tDr4kxDlDQJDLyO2MM3?usp=sharing
Tas
k 1:

Tas 1. print("Hello, World!")


k 2:

2. # change this code

mystring = "hello"

myfloat = 10.0

myint = 20

# testing code

if mystring == "hello":

print("String: %s" % mystring)

if isinstance(myfloat, float) and myfloat == 10.0:

print("Float: %f" % myfloat)

if isinstance(myint, int) and myint == 20:

print("Integer: %d" % myint)

2
SVKM’s NMIMS University
Mukesh Patel School of Technology Management & Engineering
COURSE: Basics of Python Lab Manual
BTI Sem IV Academic Year 2024-2025

3. x = object()

y = object()

# TODO: change this code

x_list = [x] * 10

y_list = [y] * 10

big_list = x_list + y_list

print("x_list contains %d objects" % len(x_list))

print("y_list contains %d objects" % len(y_list))

print("big_list contains %d objects" % len(big_list))

# testing code

if x_list.count(x) == 10 and y_list.count(y) == 10:

print("Almost there...")

if big_list.count(x) == 10 and big_list.count(y) == 10:

print("Great!")

Tas Savings=100
k
3:a print(Savings)

3
SVKM’s NMIMS University
Mukesh Patel School of Technology Management & Engineering
COURSE: Basics of Python Lab Manual
BTI Sem IV Academic Year 2024-2025

b num1=int(input("Enter first number "))

num2=int(input("Enter second "))

sign=input("Enter + to add, - to substract, * for multiply and / for divide ")

if(sign=='+'):

print("Ans is",num1+num2)

elif(sign=='-'):

print("Ans is",num1-num2)

elif(sign=='*'):

print("Ans is",num1*num2)

elif(sign=='/'):

print("Ans is",num1/num2)

else:

print("Invalid sign")

c print(f"You will have {100*1.1**7} after 7 years ")

d print("The division is", 8958937768937/2851718461558)

e num1=int(input("Enter first number "))

num2=int(input("Enter second number "))

print("Sum is",num1+num2)

print("Difference is",num1-num2)

print("product is",num1*num2)

4
SVKM’s NMIMS University
Mukesh Patel School of Technology Management & Engineering
COURSE: Basics of Python Lab Manual
BTI Sem IV Academic Year 2024-2025

f num1=int(input("Enter first number "))

num2=int(input("Enter second number "))

print("Int division is ",num1//num2)

print("Float division is ",num1/num2)

g age=int(input("Enter your age "))

first_name=input("Enter your first name ")

last_name=input("Enter your last name ")

print("Age of",first_name,last_name,"is",age)

h radius=int(input("Enter radius "))

print("Area is",3.14*radius**2,"Circumference is",2*3.14*radius)

i P=int(input("Principle(amount): "))

T=int(input("Time: "))

R=float(input("Rate: "))

Interest=P*(1+R/100)**T

print("Compound interest =",Interest-P)

j sum=0

for i in range(1,6):

nums=int(input(f"Enter number {i}: "))

sum=nums+sum

print("The sum is",sum,"the average is",sum/5)

if(sum<100):

print("True, sum is less than 100")

else:

print("false, sum is not less than 100")

5
SVKM’s NMIMS University
Mukesh Patel School of Technology Management & Engineering
COURSE: Basics of Python Lab Manual
BTI Sem IV Academic Year 2024-2025

k A=int(input("Enter a "))

B=int(input("Enter b "))

print("Remainder is",A%B)

print("Floor division is",A//B)

print("A raised to B is",A**B)

l A=int(input("Enter value of A "))

print("Bitwise left shift-",A<<1)

print("Bitwise right shift-",A>>1)

Tas https://python-iitk.vlabs.ac.in/exp/arithmetic-operations/simulation.html
k 4:

6
SVKM’s NMIMS University
Mukesh Patel School of Technology Management & Engineering
COURSE: Basics of Python Lab Manual
BTI Sem IV Academic Year 2024-2025

B.2 Input and Output:

Tas
k 1:

Figure 1. google colab

Tas
k 2:

Figure 2-Task 2-a

7
SVKM’s NMIMS University
Mukesh Patel School of Technology Management & Engineering
COURSE: Basics of Python Lab Manual
BTI Sem IV Academic Year 2024-2025

Figure 3-Task 2-b

Figure 4-Task 2-c

Tas
k
3:A

Figure 5-Task 3-a

Figure 6-Task 3-b

8
SVKM’s NMIMS University
Mukesh Patel School of Technology Management & Engineering
COURSE: Basics of Python Lab Manual
BTI Sem IV Academic Year 2024-2025

Figure 7-Task 3-c

Figure 8-Task 3-d

Figure 9-Task 3-e

Figure 10-Task 3-f

9
SVKM’s NMIMS University
Mukesh Patel School of Technology Management & Engineering
COURSE: Basics of Python Lab Manual
BTI Sem IV Academic Year 2024-2025

Figure 11-Task 3-g

Figure 12-Task 3-h

Figure 13-Task 3-i

10
SVKM’s NMIMS University
Mukesh Patel School of Technology Management & Engineering
COURSE: Basics of Python Lab Manual
BTI Sem IV Academic Year 2024-2025

Figure 14-Task 3-j

Figure 15-Task 3-k

Figure 16-Task 3-l

11
SVKM’s NMIMS University
Mukesh Patel School of Technology Management & Engineering
COURSE: Basics of Python Lab Manual
BTI Sem IV Academic Year 2024-2025

Tas
k 4:

Figure 17-task 4

B.3 Conclusion:

We learnt about oprands in python and how to use them.

12

You might also like