Data Analysis Using Python Lab
Data Analysis Using Python Lab
Ex : No.1
Python Data Structures: Develop an application
that uses different python data structures
Dictionaries
Lists
Tuples
Sets
Different Users of Inbuilt Data Structure:
Tuples:
a)To provide easy access to a dataSet and easy manipulation
of a data set.
b)Through a single Parameter passing multiple values.
Dictionary:
a)Used to store unordered key-value pairs.
b)Anything can be used to store the data and to access them
basically.
List:
a)Multiple data types are stored and multiple actions can be
performed too.
b)Easy access and manipulation of data sets.
Set:
a)To store unique data basically.
Create a Dictionary,Add Elements in it,Display it,Access Keys and
Values,Display the Key and Value Pairs.
• capitalize( ) function
• lower( ) function
• title( ) function
• casefold( ) function
• upper( ) function
• count( ) function
• find( ) function
• replace( ) function
• swapcase( ) function
• join( ) function
Python String Functions
capitalize( ) function
• The capitalize() function returns a string where the first
character is the upper case.
Syntax: string.capitalize()
Example 1: Make the first letter upper case in the given
sentence
string = “cmr university soet“
print(string.capitalize())
• Output:
Cmr university soet
Python String Functions
lower( ) function
• The lower() function returns a string where all the
characters in a given string are lower case. This
function doesn’t do anything with Symbols and
Numbers i.e, simply ignored these things.
Syntax: string.lower() Example 1: Lower case the given
string
• string = "Cmr University Soet“
• print(string.lower())
• Output:
cmr university soet
Python String Functions
upper( ) function
• The upper() function returns a string where all the characters
in a given string are in the upper case. This function doesn’t
do anything with Symbols and Numbers i.e, simply ignored
these things.
Syntax: string.upper()
Example 1: Upper case the given string
• string = “cmr university is one of the top university in
karnataka“
• print(string.upper())
Output
• capitalize( ) function
• lower( ) function
• title( ) function
• casefold( ) function
• upper( ) function
• count( ) function
• find( ) function
• replace( ) function
• swapcase( ) function
• join( ) function