We use cookies to improve your experience. If you continue to use our site, we'll assume that you're happy with it. :)

Calculate a Execution Time of a Python Program to Create Acronyms

Python is one of the most top-leading language now-a-days and will scale a a lot in future as Machine Learning and Data Science Integrations are added.

If you're a Newbie, I recommend you to read "Improve your Python Programming Skills" and then get started as a developer.

In many ways, it's a dull language, borrowing solid old concepts from many other languages and styles: boring syntax, unsurprising semantics, few automatic coercions, etc etc. But that's one of the things I like about Python. - Tim Peters

As we know, Python is a Interpreted High-Level Programming Language and it's kind of slow in-compare to Java Programming Language. But Trust me it's a top-leading programming language.

Today I'll Demonstrate a Python Code by which you can calculate the execution time of Programs to create Acronyms.

Here we'll need to import time in the program to get started accordingly.

Source Code - (Execution Time + Create Acronmys)

from time import time
start = time()

#Python Program to Create Acronyms (CodeWithDevops)
word = "Code With Devops"
text = word.split()
a = ""
for i in text:
	a = a+str(i[0]).upper()
print(a)

end = time()
execution_time = end - start
print("Execution Time: ", execution_time)
This Above Code will need to put the Word through a User and It will result with the Acronym and Execution Time.
For Example, take a look and this Output.



Just Copy/Paste the Code from Above

Post a Comment