Task 6 Given a string, create a new string with all the consecutive duplicates removed. Hint: You may make a new string to store the result. You can check whether the current character and the next character are the same, then add that character to the new string. Sample Input: АAАВВBBCDDBBЕСЕ Sample Output: АВCDBЕСE

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter7: String Manipulation
Section: Chapter Questions
Problem 25RQ
icon
Related questions
Question

Must show it in Python:

Please show step by step with comments.

Please show it in simplest form.

Please don't use any functions

Please don't use any def func ()

Task 6
Given a string, create a new string with all the consecutive duplicates removed.
===============
=====%3D
Hint: You may make a new string to store the result. You can check whether the current character and the next character are the same, then add that
character to the new string.
====
====
Sample Input:
AAABBBBCDDBBECE
Sample Output:
АВCDBECE
====== ====
=============
Transcribed Image Text:Task 6 Given a string, create a new string with all the consecutive duplicates removed. =============== =====%3D Hint: You may make a new string to store the result. You can check whether the current character and the next character are the same, then add that character to the new string. ==== ==== Sample Input: AAABBBBCDDBBECE Sample Output: АВCDBECE ====== ==== =============
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Concept of Parenthesis
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning