0% found this document useful (0 votes)
4 views

Experiment 1 1 Bubble Sort

The document outlines a series of Python programming assignments focused on string manipulation and regular expressions (RegEx). It includes tasks such as searching for literals, removing ANSI escape sequences, splitting strings with multiple delimiters, and evaluating expressions. Additionally, it covers checking vowel conditions in words and finding substrings within a given text.

Uploaded by

211127
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Experiment 1 1 Bubble Sort

The document outlines a series of Python programming assignments focused on string manipulation and regular expressions (RegEx). It includes tasks such as searching for literals, removing ANSI escape sequences, splitting strings with multiple delimiters, and evaluating expressions. Additionally, it covers checking vowel conditions in words and finding substrings within a given text.

Uploaded by

211127
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Experiment 1 1 Bubble sort .

12.Selection sort algorithm


13.inserion sort algorithm

14.binary search
15.Merge sort

16.quick sort
17.radix sort

Topic: RegEx in python


Pradyumn Vashisht
211127
Assignment 19

Objective:
1. Write a Python program to search a literals string in a string and
also find the location within the original string where the pattern
occurs. Go to the editor
Sample text : 'The quick brown fox jumps over the lazy dog.'

Searched words : 'fox'

2. Write a Python program to remove the ANSI escape sequences from a


string
3. Write a Python program to split a string with multiple delimiters.
Go to the editor
Note : A delimiter is a sequence of one or more characters used to
specify the boundary between separate, independent regions in plain
text or other data streams. An example of a delimiter is the comma
character, which acts as a field delimiter in a sequence of
comma-separated values.
4. Write a Python program to remove the parenthesis area in a string.
Sample data : ["example (.com)", "w3resource", "github (.com)",
"stackoverflow (.com)"]

Expected Output:

example

w3resource

github

Stackoverflow

5. Write a Python program that reads a given expression and evaluates


it.

Terms and conditions:

The expression consists of numerical values, operators and parentheses,


and the ends with '='.

The operators includes +, -, *, / where, represents, addition,


subtraction, multiplication and division.

When two operators have the same precedence, they are applied to left
to right.

You may assume that there is no division by zero.


All calculation is performed as integers, and after the decimal point
should be truncated Length of the expression will not exceed 100.

-1 ? 10 9 = intermediate results of computation = 10 9

6. Write a Python program that checks whether a word stars and ends
with a vowel in a given string. Return true if a word matches the
condition; otherwise, return false.

Sample Data:
("Red Orange White") -> True
("Red White Black") -> False
("abcd dkise eosksu") -> True
7. Write a Python program that takes a string with some words. For two
consecutive words in the said string, check whether the first word ends
with a vowel and the next word begins with a vowel. If the program
satisfy the said condition, return true other false. Only one space is
allowed between the words.
Sample Data:
("These exercises can be used for practice.") -> True
("Following exercises should be removed for practice.") -> False
("I use these stories in my classroom.") -> True

8. Write a Python program to abbreviate 'Road' as 'Rd.' in a given


string.

9. Write a Python program to find the substrings within a string.


Sample text :
'Python exercises, PHP exercises, C# exercises'
Pattern :

'exercises'

Note: There are two instances of exercises in the input string.\

10. Write a Python program to search some literals strings in a string.


Sample text : 'The quick brown fox jumps over the lazy dog.'

Searched words : 'fox', 'dog', 'horse'

You might also like