An Acronym Generator will take a String as an input and it will return the initials of all the words in the String.
Hey everyone, today we are going to create a simple Acronym Generator using Python.
So basically an Acronym Generator will take a String as an input and it will return the initials of all the words in the String.
To get started, we need a phrase from the user. We can do that using the input() method.
user_input = input("Enter a phrase: ")
We have stored the user input in a user_input variable.
Now we must ignore words like ‘of’ from the user input as most of the time, ‘of’ is not considered for acronyms.
Also, we need to separate each word and store it individually in a form of a list so that we can easily iterate through it.
phrase = (user_input.replace('of', '')).split()
Here in user_input.replace('of', '') we are using .replace() function to ignore 'of' from the input, if any.
And then we are using .split() function to break down the string into individual words and store them as a list in phrase variable.
Python Programming Tutorials For Beginners
Python is an interpreted, high-level, powerful general-purpose programming language. You may ask, Python’s a snake right? and Why is this programming language named after it?
Python Complete Beginners Tutorial. Introduction To Python | Function, Recursion, Type conversion and Coercion, Lambda Function, Strings.
🔵 Intellipaat Python course: https://intellipaat.com/python-certification-training-online/In this Python tutorial for beginners video, you will learn every...
This video will help you create your first Python Program. It is the most imortant step of this Python Tutorial for Beginners and will make sure you understand how Python program runs.