8000 GitHub - Erdincuzunlu/DifficultQestion: Before After
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Erdincuzunlu/DifficultQestion

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

0