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

7

Uploaded by

cbse.4005
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

7

Uploaded by

cbse.4005
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

# 24 .Write a program to count the number of words present in a string.

# 25. Write a program to count the number of vowels and consonants in a given string.
# 26. Write a program to replace all white space by a # in a given string.
# 27. Write a program to print the number of
 Upper case
 Lower Case
 Digits
 Special characters
In the given string.
# 28. Write a program that prompt the user for a string
❖ extract all the digits from the string.
If there are digits :
❖ A sum the collected digits together
print out :
• the original string • the digits the sum of the digits •
❖ If there are no digits:
print the original string and a message "has no digits".
# 29. Write a Python program as per specifications given below:

• Repeatedly prompt for a sentence (string) or for 'q' to quit.


• Upon input of a sentence s, print the string produced from s by converting each lower-case
letter to upper case and each upper case letter to lower case.
• All other characters are left unchanged.
# 30. Write a program which reverses a string and stores the reversed string in a new string.
and where the given string is a palindrome.
# 31 . Write a program that ask the user to input a number to append to a list until the user wants
to.
# 32 . Write a program that ask the user to input 5 numbers to append to a list and prints the sum
and average of the list.
# 33 . Write a program that ask the user to input a List. Creates two new lists (OddList ,
EvenList)which has odd and even numbers respectively
# 34. Write a program that ask the user to input a List and a Values. Do a binary search of list to
find the position of value in the list

You might also like