You should be familiar with the concept of reversing a string. In this task, you will write a different variation where not all characters are reversed. In particular, you will write a function reverse_lower (s:str) -> str that only reverses lowercase letters and leave other characters where they are. For example, reverse_lower('aBcD45ef') ==> 'fBeD45ca' In the example above, we only reverse acef which gives feca, but then in the return string you need to make sure that other characters remain at the same location. Therefore, the return string is fBeD45ca. Note how we leave _B_D45 unchanged. reverse_lower('abc') == 'cba' reverse_lower('ABC') == 'ABC' reverse_lower('A123bc') == 'A123cb' reverse_lower('muic-2021') == 'cium-2021' reverse_lower('M-ahid--ol') 'M-lodi--ha'

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

assert (reverse_lower('abc') == 'cba')
assert (reverse_lower('ABC') == 'ABC')
assert (reverse_lower('A123bc') == 'A123cb')
assert (reverse_lower('muic-2021') == 'cium-2021')
assert (reverse_lower('M-ahid--ol') == 'M-lodi--ha')
assert (reverse_lower('XJjHVzheiy') == 'XJyHViehzj')
assert (reverse_lower('L5bIgto2gv6W') == 'L5vIgot2gb6W')
assert (reverse_lower('sYmA5Poekfz0k9') == 'kYzA5Pfkeom0s9')
assert (reverse_lower('hDuAt5zqBSFg6-F3') == 'gDqAz5tuBSFh6-F3')
assert (reverse_lower('MreN13pdEbI28D1J3N') == 'MbdN13peErI28D1J3N')

Partly Reverse
You should be familiar with the concept of reversing a string. In this task, you will write a different variation
where not all characters are reversed.
In particular, you will write a function reverse_lower (s:str) -> str that only reverses lowercase letters and
leave other characters where they are. For example,
reverse_lower('aBcD45ef') ==> 'fBeD45ca'
TEST CASES
In the example above, we only reverse acef which gives feca, but then in the return string you need to
make sure that other characters remain at the same location. Therefore, the return string is fBeD45ca.
Note how we leave _B_D45 unchanged.
reverse_lower('abc')
'cba'
reverse_lower ('ABC') == 'ABC'
reverse_lower('A123bc') == 'A123cb'
==
reverse_lower('muic-2021') == 'cium-2021'
reverse_lower('M-ahid--ol') == 'M-lodi--ha'
Transcribed Image Text:Partly Reverse You should be familiar with the concept of reversing a string. In this task, you will write a different variation where not all characters are reversed. In particular, you will write a function reverse_lower (s:str) -> str that only reverses lowercase letters and leave other characters where they are. For example, reverse_lower('aBcD45ef') ==> 'fBeD45ca' TEST CASES In the example above, we only reverse acef which gives feca, but then in the return string you need to make sure that other characters remain at the same location. Therefore, the return string is fBeD45ca. Note how we leave _B_D45 unchanged. reverse_lower('abc') 'cba' reverse_lower ('ABC') == 'ABC' reverse_lower('A123bc') == 'A123cb' == reverse_lower('muic-2021') == 'cium-2021' reverse_lower('M-ahid--ol') == 'M-lodi--ha'
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Function Arguments
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education