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

Python Lab Assignment

Python

Uploaded by

sbsollapur14
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Python Lab Assignment

Python

Uploaded by

sbsollapur14
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Name: Santosh Savanur

Subject: Python Lab Assignment

Program 1: Write a program to create a string made of the first, middle and
last character of the input string (Input: hello, Output: hlo).

Program 2: Write a program to create a string made of the middle


three characters of the input string.
Program 3: Write a Python program to check whether the string is
Palindrome or not.

Program 4: Write a Python program to print even length words in a string (Input:
s = "This is a python language" Output: This is python language).
Program 5: Write a Python program to modify a given string according to the
following:
 Add ' ing ' at the end of a given string, if the length of it is at least
3.
 If the given string already ends with ' ing ' then add ly '
 If the string length of the given string is less than 3, leave it
unchanged.
Program 6: Find the number of occurrences of a substring in a given main string,
ignoring the case.

Program 7: Write a program to check whether two strings are anagrams (An
anagram of a string is another string that contains the same characters, only the
order of characters can be different) or not.
Program 8 : Write a program to find the longest word and the length of the
longest one in a string.
Program 9 : Given a sentence, count the frequency of words and find the word with max
frequency.

You might also like