Professional Documents
Culture Documents
Source Code :
#ImmutableDataTypes
a=5
print("Type of a: ", type(a))
b = 4.3
print("\nType of b: ", type(b))
c = 2 + 4j
print("\nType of c: ", type(c))
Output :
Mutable Data type
Source Code :
#MutableDataTypes
List = ["khushi", "abhay", "tanishq"]
print(List[2])
set = {"jatin","saurabh","maitri"}
print(set)
Output :
2. take input from the user and Implement operators in python
source Code :
Output :
3. Implement different arraysmethods
source Code :
#Array
Num=["3","2","1"]
Num.append("5")
print(Num)
Num.sort()
print(Num)
Num.pop(1)
print(Num)
Output :
4. Implement different string methods
source Code :
#String
str='Kenneth'
print(str.upper())
print(str.lower())
print(str.swapcase())
print(str.rfind('h'))
print(str.replace('eth','y'))
Output :