Software engineering and personal development

Month: April 2021

How to Find the First Element in a List in Python Without Using the Index 0

Photo by Chris Ried on Unsplash

One of the most common ways of finding the first element in a list in Python is using the index 0.

I was recently thinking of coming up with a more creative idea and I figured out another way.

It’s not something that you may have not figured out yourself. It also doesn’t mean that someone doesn’t know it.

Still, there is always someone who may also find it helpful or that hasn’t had the chance to have time to think about it.

Continue reading

How to Convert a Natural-language-like String into a Date in Python

turned on gray laptop computer
Photo by Oskar Yildiz on Unsplash

You have probably come across situations in which you needed to convert a string into a date in Python. There are a few ways to do that, but you may have not had the chance to use the following method.

It’s not that it is so special that you cannot learn, or that it is so difficult what’s going on. It’s basically a rare conversion that you have not had the chance to stumble upon before.

Continue reading

How To Find The Index Of An Item In A Tuple In Python

turned-on flat screen TV
Photo by Alexandru Acea on Unsplash

As Python is one of the most popular languages right now, many developers from other languages may also start using it whether that is just on a side project, or a simple script that can help them automate some tasks.

They may have been able to see how to actually find the index in an array, for example in Java, where you write the name of the array and also the index in the brackets. This is also available in Python.

Continue reading

© 2024 Fatos Morina

Theme by Anders NorenUp ↑