0% found this document useful (0 votes)
5 views2 pages

Sumit Chaudhari:-13 Date: - / / 2025: - Second Year B.Tech (IT) : - Python Lab: - 02

The document outlines a Python lab exercise for B.Tech students, focusing on expressions, variables, and basic mathematical operations. It includes examples of integer operations, string manipulation, and comparisons between strings. The output of each code snippet is provided to illustrate the results of the operations performed.

Uploaded by

ninhokay0726
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)
5 views2 pages

Sumit Chaudhari:-13 Date: - / / 2025: - Second Year B.Tech (IT) : - Python Lab: - 02

The document outlines a Python lab exercise for B.Tech students, focusing on expressions, variables, and basic mathematical operations. It includes examples of integer operations, string manipulation, and comparisons between strings. The output of each code snippet is provided to illustrate the results of the operations performed.

Uploaded by

ninhokay0726
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/ 2

Name Sumit chaudhari

Roll no :- 13 Date :- / / 2025 Sign :-


Branch :- Second Year B.Tech (IT)
Sub:- Python Lab
Exp. No:- 02
Remark :-

Title : Write a python program to understand expressions, variables and basic


Math operations.

# Mathematical operation on Intergers

#Input print ("Sum is", 45+56)

print("Substraction is :",56-45)

print("Division is:",56/2)

print("Multipication is:",45*56)

#Output

Sum is 101

Substraction is : 11

Division is: 28.0

Multipication is: 2520

#Remove and insert of elements in the string

#Input List =

[ 3,6,8,9]

print(List)

List.append(12)

print(List)

List.remove(8)

print(List)
#Output

[3,6, 8, 9]

[3,6, 8, 9,12]

[3, 6, 9,12]

#Compairing two strings

#Input str1 ="Hello World!"

str2 ="Hello Python" str3

="Hello World!" print(str1==str2

,"its not correct")

print(str1==str3,"this one")

#Output

False its not correct

True this one

#Index value of strings

#Input str1 ="Hello World!"

print(str1[0],str1[2],str1[3],str1[4],str1[5],str1[6],str1[7])

#Output

HlloWo

You might also like