Answer to Question #231871 in Python for Manish

Question #231871
In a bank there are two types of transactions: credit and debit. All transactions are assigned an alphabetical ID. Credit transactions are assigned a vowel and debit transactions are assigned a consonant. To track transactions over a year, all the transaction IDs are combined to form a string of IDs for each customer. A customer wishes to know the number of times he made a debit transaction immediately after a credit transaction.

Write an algorithm to print the count of debit transactions that were made immediately after a credit transaction for that particular customer
1
Expert's answer
2021-09-01T05:50:55-0400
class Main(object):
   main():
   count =0
         print("Enter credit transaction id: ")
          Credit Id= int(input())
         print("Enter debit transaction id: ")
          Debit Id= int(input())
        s =creditID+debitID
          print(s)


        i = 0
        while i < len(s):
            if s[i] != ' ':
                count += 1
            i += 1
        print("Count= " + count)
        main()

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS