Nothing Special   »   [go: up one dir, main page]

Indian Institute of Information Technology, Ranchi: Assignment - 06 Python Programming Lab Date: 29/09/2021

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Indian Institute of Information Technology, Ranchi

Assignment -06
Python Programming Lab
Date: 29/09/2021
--------------------------------------------------------------------------------------------------------
1. Write the program to calculate the length of a string.
2. Write a program to check whether a string start with specified
characters.
3. Write a program to add a prefix text to all of the lines in a string.
4. Write a program to print floating numbers up to 2 decimal places.
5. Write a program to print integer with zeros on the left of specified
width.
6. Write a program to display a number in left, right, and centre aligned
of width 10.
7. Write a program to create a mirror of the given string. For example
“abcd”=”dcba”
8. Write a program to remove all the occurrences of a specified given
word from the string.
9. Write a program to insert a string in another string.
10. Write a program to delete a string from another string.
11. Write a program to check if each word in a string begins with a
capital letter?
12. Write a program to check if a string contains a specific
substring.
13. Write a program to count the number of a specific character in a
string.
14. Write a program to remove vowels from a string.
15. Write a program to find the number of vowels, consonents,
digits and white space characters in a string.
16. Write a program to find the length of the string
"IIITRanchistudents" without using len function.
17. Write a program to find out the largest and smallest word in the
string "You are IIIT Ranchi Students".
18. Write down the names of 10 of your friends in a list and then
sort those in alphabetically ascending order.
19. Write a program to check if the two strings entered by user are
anagrams or not. Two words are said to be anagrams if the letters of
one word can be rearranged to form the other word. For example,
“ranchi” and “chiran” are anagrams of each other.

*************

You might also like