Ass2 Itw
Ass2 Itw
Aim: Write a program to demonstrate String Manipulation in python and perform: Accessing
Individual Elements, String Operators, String Slices, String Functions and Methods.
Problem Statement: Write a program to count the numbers of characters in the string and
store them in a dictionary data structure.
Theory:
Python String
• A string is a data structure in Python that represents a sequence of characters.
• It is an immutable data type, meaning that once you have created a string, you cannot
change it.
• Strings are used widely in many different applications, such as storing and manipulating
text data, representing names, addresses, and other types of data that can be represented
as text.
Output:
A Computer Science portal for geeks
Code:
Output:
#double quote
Output:
#Triple quote
random nature'''
print(String3)
Output:
2.Characters of String
#character of string
4.Slicing
Output:
5.String Method
print(String8.expandtabs(8))
Output:
Conclusion: In this way we have demonstrated String Manipulation in python and performed
Accessing Individual Elements, String Operators, String Slices, String Functions and Methods.