python
python
Output:-
This is the string 1
This is the string 2
This is the string 3
#Declaring a list
lst=[6,"A1","Rohit",1+2]
print(lst)
Output:-
[6, 'A1', 'Rohit', 3]
[6, 'A1', 'Rohit', 3, 7]
[6, 'A1', 'Rohit', 3]
A1
#Declaring a Tuple
tup=(1,"a","string",1+2)
print(tup)
Output:-
(1, 'a', 'string', 3)
a
#displaying datatypes
print(type(stu_id))
Output:-
{128, 130, 122, 124, 126}
<class 'set'>
Output:-
{'Italy': 'Rome', 'France': 'Paris', 'England': 'London'}
Experiment No 2
Name:- Rohit Vitthal Desai Roll no:- 06
Class:- SE(AIML) Sem:- 4th Sub:- Pyhton
****************************************************************
Aim:- Creating function, classes & objects using python,
Demonstrate exception handling & inheritance
Output:-
Welcome to SSPM
#Driver Code
num1, num2 = 5, 20
ans= add(num1,num2)
print(f"The addition of {num1} & {num2} is : {ans}")
Output:-
The addition of 5 & 20 is : 25