You are on page 1of 14

Summer Fields School

DLF, Phase-I, Gurugram,


Haryana

Subject: Computer Science (083) Topic: (Strings in

Python) Name ……………………..… Class & Sec: XI-…….

Date ………/2022

1. Write Program for the following:


1. Write a Python program to remove the characters which have odd index values of a
str
2. Write a Python script that takes input from the user and displays that input back in
upper and lower cases
3. Write a program in python to check if a Substring is present in a given String or not.

4. Write a program in python to count and display vowels in a string.


5. Write a program in python to count and display number of words in a string.
6. Write a Python program to calculate the length of a string, without using len().
7. Write a Python function that takes a list of words and returns the length of the longest one.
8. Write a Python program to change a given string to a new string where the first and
last chars have been exchanged.
9. Write a program in python to reverse words in each String in Python.
10. Write a Python program to Check Whether a String is Palindrome or Not.
11. Write a program that asks the user to enter two strings of the same length. The program
should then check to see if the strings are of the same length. If they are not, the program
should print an appropriate message and exit. If they are of the same length, the program
should alternate the characters of the two strings. For example, if the user enters xyz and
ABC the program should print out AxByCz.
12. Write a program that asks the user to enter their name in lowercase and then
capitalizes the first letter of each word of their name.

13. Write a program that asks the user to enter a string and then print the following:
a. The string repeated 10 times

b. The last three characters of the string


c. The string backwards
d. The string in all caps

You might also like