STRING HANDLING
#Finding String length
string1 ='Hello Python'
print (len(string1))
#Concatenating Strings
string2=' World'
print (string1 + string2)
num=100
print (string1 + str(num))
#Print a String multiple times
print (string1 *10)
str1 ='Hello'
print ([Link]())
str2 ='12345'
print ([Link]())
print ([Link]())
print ([Link]())
str6 = 'Python Programming Language'
print ([Link]('e'))
print ([Link]('age'))
print ([Link]('Language'))
print ([Link]('Programming Language'))
print ([Link]('Programming'))
str7 = 'Python is a Programming Language, Python is an Open source software'
print (str7)
print ([Link]('Python', 'JavaScript'))
List Methodologies
# creating an empty list
My_List = []
# number of elements as input
n = int(input("Enter number of elements : "))
# iterating till the range
for i in range(0, n):
element = (input())
# adding the element
My_List.append(element)
print("This is My_List of elements", My_List)
# extending tuple elements
My_List.extend((6, 4))
print("List after extended: ", My_List)
#inserted at index 3 (4th position)
My_List.insert(3, '5')
print('After Insterted:', My_List)
#remove 9 from the list
My_List.remove(4)
print('After removed:', My_List)
# get the index of 'dog'
index = My_List.index('5')
print("The index position of element in the list is:",index)
# check the count of 2
count = My_List.count(3)
print("Count of 3: ", count)
# reverse the order of list elements
My_List.reverse()
print("Reversed List:", My_List)