Skip to content

acronym using python #2731

Open
Open
@Hathirambalaji

Description

@Hathirambalaji

Simple Acronym Generator

def generate_acronym(phrase):
words = phrase.split() # Split the phrase into words
acronym = ""
for word in words:
acronym += word[0].upper() # Take the first letter of each word
return acronym

Example usage

phrase = "Python Yields Terrific Hacking Opportunities Now"
print(generate_acronym(phrase)) # Output: PYTHON

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions