Name: SALIN CHAUDHARY Registration Number:21ETCS002173
Computer Programming Laboratory
B. Tech. 1st Semester
Name : SALIN CHAUDHARY
Roll Number :21ETCS002173
Department : Computer Science and Engineering
Faculty of Engineering & Technology
Ramaiah University of Applied Sciences
Name: SALIN CHAUDHARY Registration Number:21ETCS002173
Ramaiah University of Applied Sciences
Private University Established in Karnataka State by Act No. 15 of 2013
Faculty Engineering & Technology
Programme B. Tech. in Computer Science and Engineering
Year/Semester 1st Year /1st Semester
Name of the Laboratory Computer Programming Laboratory
Laboratory Code 21CSS106A
List of Experiments
1. Introduction to Python programming environment
2. Variables, data types, operators and expressions
3. Input output operations
4. Logic operations and decision making
5. Loop statements
6. Character and string operations
7. Functions
8. File handling
9. Data structures
10. Libraries
Name: SALIN CHAUDHARY Registration Number:21ETCS002173
Laboratory 6
Title of the Laboratory Exercise: Character and String operations
1. Introduction and Purpose of Experiment
Astring is a sequence of characters. Strings can be manipulated using a number of built in
functions. By solving this, students will be able to manipulate string data types.
2. Aim and Objectives
Aim
To develop programs for manipulating characters and strings
Objectives
At the end of this lab, the student will be able to
Create programs to perform string operations
Create programs to manipulate strings using built in functions
3. Experimental Procedure
i. Analyse the problem statement
ii. Design an algorithm for the given problem statement and develop a
flowchart/pseudo-code
iii. Implement the algorithm in Python language
iv. Execute the Python program
v. Test the implemented program
vi. Document the Results
vii. Analyse and discuss the outcomes of the experiment
4. Questions
a. Write a Python program to check each character in the given string is an alphabet or
digit.
b. Write a Python program to find duplicate characters in the given string and store
them in a list.
c. Write a Python program to count the numbers of occurrences of characters in the
given string and store them in a dictionary.
d. Write a Python program to print alphabet pattern 'A'.
Name: SALIN CHAUDHARY Registration Number:21ETCS002173
5. Calculations/Computations/Algorithms
FLOWCHARTS
4)a.
Name: SALIN CHAUDHARY Registration Number:21ETCS002173
4)b.
Name: SALIN CHAUDHARY Registration Number:21ETCS002173
4)c.
Name: SALIN CHAUDHARY Registration Number:21ETCS002173
4)d.
Name: SALIN CHAUDHARY Registration Number:21ETCS002173
6. Presentation of Results
PROGRAM
4)a.
OUTPUT
Name: SALIN CHAUDHARY Registration Number:21ETCS002173
PROGRAM
4)b.
OUTPUT
Name: SALIN CHAUDHARY Registration Number:21ETCS002173
PROGRAM
4)c.
OUTPUT
Name: SALIN CHAUDHARY Registration Number:21ETCS002173
PROGRAM
4)d.
OUTPUT
Name: SALIN CHAUDHARY Registration Number:21ETCS002173
7. Conclusions
IN THE FIRST PROGRAM WE LEARNT HOW TO CHECK FOR DIGIT OR CHARACTER IN A
STRING. IN THE SECOND PROGRAM WE LEARNT HOW TO FIND DUPLICATE VALUES
AND ALSO STORE THEM IN A LIST .IN THE THIRD PROGRAM WE GOT TO LEARN HOW
TO COUNT OCCURRENCES OF THE CHARACTERS AND STORE THEM IN DICTIONARY
FORM. IN THE FOURTH PROGRAM WE LEARNT HOW TO PRINT A IN A PATTERN
USING THE * SYMBOL.