How to create half of the string in uppercase and the other half in lowercase ? |
import math NEW_LINE string1 = ' geeks ▁ for ▁ geeks ' NEW_LINE string1_len = len ( string1 ) NEW_LINE half_string = math . ceil ( string1_len / 2 ) NEW_LINE part_a = ' ' NEW_LINE part_b = ' ' NEW_LINE part_a = string1 [ : half_string ] NEW_LINE new_part_a = part_a . upper ( ) NEW_LINE part_b = string1 [ half_string : string1_len ] NEW_LINE changed_string = new_part_a + part_b NEW_LINE print ( changed_string ) NEW_LINE