Please type out excat code Assume two banks want to establis

Please type out excat code!!!

Assume two banks want to establish a secure communication channel so that they can share amount of money at each bank. They agree that number of \'s\' character represents amount of dollars and number of \'c\' character represents number of cents. For example, the sentence \"This is a program that is written in C code.\" contains three \'S\'s and two \'C\'s, which means the sender has three dollars and two cents. Write a program in Python that satisfy the above goal. That is, your Python code requests a user to enter an arbitrary sentence and presents number of \'S\'s, number of \'C\'s, and the total amount of money in dollar and cents.

Solution

Solution for the problem(Python) :-

Program :-

from collections import Counter
str = input(\"Enter an arbitary sentence :- \")
counter = Counter(str)
s=counter[\'s\']+counter[\'S\']
c=counter[\'c\']+counter[\'C\']
print (\"The sentence contain\",s,\" \'S\'s\")
print (\"The sentence contain\",c,\" \'C\'s\")
print (\"the amount of money in dollors : \",s,\" Dollors\" )
print (\"the amount of money in Cents : \",c,\" Cents\" )

Output:-

Thank you!

Please type out excat code!!! Assume two banks want to establish a secure communication channel so that they can share amount of money at each bank. They agree

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site