Removing duplicates in lists in python Part-1
In this article, let’s discuss the different ways in which we can make a unique list by removing all the
if-else clause in a list comprehension in python
List comprehensions are used for creating new lists from other iterables like tuples, strings, arrays, lists, etc. List comprehension in
Generate random integers between 0 and 9 in python
In this article, let’s learn the different ways of generating random integers for a specified range.Using randrange Using randint
Converting integer to string in Python
We can convert an integer into a string using the following waysUsing str() Using %s Using format() Using f-string 1.
Reverse a string in Python
Python doesn’t have any built-in method for a string reversal like a list which has a list method list.reverse(). So,
How to remove an element from a list by index in python?
In this article let’s discuss various ways of deleting an element from a list by index.Using pop() Using slicing
How can I remove a key from a Python dictionary?
Dictionary is an unordered collection of data in the form of key-value pairs separated by commas inside curly brackets. Dictionaries
How to get the number of elements in a list in Python?
We often fall in need to know the number of elements in any sequence while iterating through it. In this
How do I get a substring of a string in Python?
There is no inbuilt method in Python like other languages to get a substring of a string. We use the
How to lowercase a string in Python?
In this article we’ll discuss two different ways of lowercase conversion of any given stringUsing lower() Using casefold() Using lower(): The