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

string python program

The document contains multiple Python programming tasks that involve string manipulation. Tasks include calculating telegram costs based on word count, identifying words with consecutive identical letters, sorting characters by ASCII values, finding the largest word in a sentence, and counting alphanumeric words. Each task specifies not to use the split() function for word processing.

Uploaded by

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

string python program

The document contains multiple Python programming tasks that involve string manipulation. Tasks include calculating telegram costs based on word count, identifying words with consecutive identical letters, sorting characters by ASCII values, finding the largest word in a sentence, and counting alphanumeric words. Each task specifies not to use the split() function for word processing.

Uploaded by

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

10 Wrte aprogram in Python to accept anmessage for atelegram and computethe bill.

If there are lessthan 3


10 words then cach word is charged Rs. 0.80 and if there are more than 10 words then charge will be
Rs. 10 and Rs. 0.60 for each word exceeding 10.
NB. Without using split() function
create list of dictionary where each dictionary contains
35. Write a Program in Python which takes one sentence as input and displays and counts
only those words where consecutive alphabets within the word is/arc same.
Example if the scntence taken as input is
"To add insult to injury the car drove offwithout stopping afler knocking me off my bike"
The output will be:
Count=4
add
off
stopping
of
31. Write a program in Python which takes one string as input and arranges the characters of 4
the string in ascending order of ASCII/UNICODE Characters of string.

Example: input- "HSMS123"


Output: "123HMSS"
4(a) Write a program in Python which takes one sentence as input and displays the 4
largest word in that sentence.(Assume that every word taken as input in the
sentence are of different length)
Ex- In the sentence "India is a big country" "country" is the largest word

NOTE: Do not use split() function in the program.

(b) 4
Write a program in python which takes one sentence as input and counts and
displays the number of alphanumeric words present in it.
Our Definition : The definition of alphanumeric is string that contains letters
and numbers only.
Example:- In the sentence "My PAN number is QWE176F and my vehicle
number is WB40A2968"
Output: QWE176F WB40A2968 Total words=2

NOTE: Do not use split() function in the program.

You might also like