Open in app

Sign in

Write

Sign in

Fatos Morina
Fatos Morina

5K Followers

Home

About

Published in

Python in Plain English

·Aug 1, 2022

How to Round Numbers Using Negative Numbers in Python

If you are working with many numbers in Python, you probably need to do some rounding to cut off some digits that you may not need at all. For example, let us say that you are calculating an average salary in a company and the average number that you have…

Python

2 min read

How to Round Numbers Using Negative Numbers in Python
How to Round Numbers Using Negative Numbers in Python
Python

2 min read


Published in

Python in Plain English

·Aug 1, 2022

How to Quickly Check Whether a String is a Palindrome in Python

A palindrome is a word that is the same whether you read it forwards or backward. Checking whether an input string is a palindrome can be a common interview question that you may encounter at least in one of the technical rounds of your interviews. Fortunately, we can do it…

Python

1 min read

How to Quickly Check Whether a String is a Palindrome in Python
How to Quickly Check Whether a String is a Palindrome in Python
Python

1 min read


Published in

Python in Plain English

·Jul 7, 2022

3 Ways to Check if a List is Empty in Python

A guide on how to check if a list is empty in Python. — Lists are used pretty much all over the place in Python and in other programming languages as well. Checking whether they have elements or not represents something that you may need to do. One interesting thing about Python is that it allows you to do the same thing in more…

Python

2 min read

3 Ways to Check if a List is Empty in Python
3 Ways to Check if a List is Empty in Python
Python

2 min read


Published in

Python in Plain English

·Jul 4, 2022

How to Quickly Find the Symmetric Difference of 2 Sets in Python

A guide on how to find the symmetric difference of 2 sets in Python. — If you have to find the union of elements that are either in the first or the second set, but not in both of them, then you need to use the symmetric difference. This is also another math operation between sets that you have probably seen in a math class…

Python

1 min read

How to Quickly Find the Symmetric Difference of 2 Sets in Python
How to Quickly Find the Symmetric Difference of 2 Sets in Python
Python

1 min read


Published in

Python in Plain English

·Jul 4, 2022

How to Quickly Find the Difference Between 2 Sets in Python

A guide on how to find the difference between 2 sets in Python. — There can be cases when you may need to find the difference between 2 sets in Python. If you do not remember from high school, the difference between 2 sets means that we get the elements from the first set that are not in the second set. We can do…

Python

1 min read

How to Quickly Find the Difference Between 2 Sets in Python
How to Quickly Find the Difference Between 2 Sets in Python
Python

1 min read


Published in

Python in Plain English

·Jul 4, 2022

How to Quickly Find the Union of 2 Sets in Python

A tutorial on how to find the union of two sets in Python. — In the last article, we saw how we can find the difference between 2 sets in Python. In this article, we are going to see how to find the union of 2 sets. This is actually quite similar to the difference. We also have 2 ways to do the union…

Python

1 min read

How to Quickly Find the Union of 2 Sets in Python
How to Quickly Find the Union of 2 Sets in Python
Python

1 min read


Published in

Python in Plain English

·Jun 20, 2022

How to Quickly Extract Elements From Lists in Python

A guide on quickly extracting elements from lists in Python. — There can be many cases when you want to get elements from a list of named variables and not have to always use indexes. For example, let us assume that we have a list that has five elements: my_list = [1, 2, 3, 4] Now we want to save the…

Python

1 min read

How to Quickly Extract Elements From Lists in Python
How to Quickly Extract Elements From Lists in Python
Python

1 min read


Published in

Python in Plain English

·Jun 14, 2022

How to Split a String on the First N Occurrences in Python

A guide on splitting a string on the first N occurrences in Python. — You have probably seen cases when you can do splits of strings into multiple parts based on a pattern that is observed in the string. For example, let us say that we want to save all the words that are part of a sentence. To do that, we usually try…

Python

2 min read

How to Split a String on the First N Occurrences in Python
How to Split a String on the First N Occurrences in Python
Python

2 min read


Published in

Python in Plain English

·Jun 13, 2022

How to Quickly Find the Longest String in a List in Python

A guide on finding the longest string in a list in Python. — If you need to find the longest string in a list in Python, you may be tempted to do that in the form of iterating through every element, finding their length, and checking whether this current length is larger than a temporary value that we have chosen in the beginning. …

Python

2 min read

How to Quickly Find the Longest String in a List in Python
How to Quickly Find the Longest String in a List in Python
Python

2 min read


Published in

Python in Plain English

·Jun 13, 2022

How to Safely Iterate Through 2 Lists in Python

A guide on iterating through two lists in Python. — Using for loops when iterating through 2 lists that have different lengths can be error-prone, especially when the lengths of these lists can change with time. Let us see an example to see when that happens: This example actually works well, but if we were to change the length…

Python

2 min read

How to Safely Iterate Through 2 Lists in Python
How to Safely Iterate Through 2 Lists in Python
Python

2 min read

Fatos Morina

Fatos Morina

5K Followers

Passionate Software Engineer

Following
  • The Educative Team

    The Educative Team

  • Fahim ul Haq

    Fahim ul Haq

  • Nicolas Cole

    Nicolas Cole

  • Trey Huffine

    Trey Huffine

  • Sik-Ho Tsang

    Sik-Ho Tsang

See all (131)

Help

Status

About

Careers

Blog

Privacy

Terms

Text to speech

Teams