Skip to content

Erdincuzunlu/DifficultQestion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

DifficultQuestion

This project contains a simple Python function that transforms a string into an alternating uppercase/lowercase format.
For example:
Input: hello
Output: HeLlO

Function Overview

def alternating(string):
    new_string = ""
    for string_index in range(len(string)):
        if string_index % 2 == 0:
            new_string += string[string_index].upper()
        else:
            new_string += string[string_index].lower()
    print(new_string)

About

Before After

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages