ItsMyCode
  • How To
  • Python
    • Basics
    • Advanced
    • Built-In Methods
    • Dictionary Methods
    • String Methods
    • List Methods
    • Date and Time
    • Files and Folders
    • Matplotlib
    • Seaborn
    • NumPy
    • Pandas
    • SciPy
    • Errors and Exception
    • Django
  • R
  • Git
  • Powershell
  • Javascript
  • C#
    • Sitecore
  • Node.js
ItsMyCode

Coding Simplified

  • How To
  • Python
    • Basics
    • Advanced
    • Built-In Methods
    • Dictionary Methods
    • String Methods
    • List Methods
    • Date and Time
    • Files and Folders
    • Matplotlib
    • Seaborn
    • NumPy
    • Pandas
    • SciPy
    • Errors and Exception
    • Django
  • R
  • Git
  • Powershell
  • Javascript
  • C#
    • Sitecore
  • Node.js
541
98
0

Home » Python » Basics

Browsing Category

Basics

30 posts
Check If A List Is Empty In Python
  • Python
  • Basics
  • 3 minute read

Check if a list is empty in Python

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • November 8, 2022
There are multiple ways to check if a list is empty in Python, and the most efficient way is by using the Pep-8 style, called “Truth Value Testing“. How to…
View Post
Convert Letters To Numbers In Python
  • Python
  • Basics
  • 2 minute read

Convert Letters to Numbers in Python

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
Using the ord() method, we can convert letters to numbers in Python. The ord() method returns an integer representing the Unicode character. In this tutorial, we will look at converting…
View Post
Python Print Variable
  • Python
  • Basics
  • 4 minute read

Python Print Variable

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
Python is one of the most versatile programming languages, and we can use the print statement in several ways to print a variable in Python. In this article, let us…
View Post
Menu Driven Program In Python
  • Python
  • Basics
  • 3 minute read

Menu Driven Program in Python

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
Introduction to Menu-Driven Program A menu driven program in Python is a program that takes input from a user by displaying a list of options and allows users to choose…
View Post
Python Exponent | Calculate Exponent In Python
  • Python
  • Basics
  • 3 minute read

Python Exponent | Calculate exponent in Python

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
Exponential is a mathematical operation where the number gets multiplied to a definite set of times to itself. For Example, 2 to the 3rd (written like this: 23) means: 2…
View Post
How To Reverse A String In Python
  • Basics
  • Python
  • 2 minute read

How to Reverse a String in Python

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
Python has many functions for string manipulation. However, the Python string library does not have any built-in reverse() function to reverse a string. Reverse a string in Python Let us…
View Post
Python Check If String Is Empty Or Not
  • Basics
  • Python
  • 3 minute read

Check if string is empty or not in Python

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
In this article, you will learn how to check if string is empty or not using different approaches with examples. Python program to check if string is empty or not…
View Post
Python Remove Newline From String
  • Python
  • Basics
  • 3 minute read

Python Remove Newline From String

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
There are times where we need to remove the newline from string while processing massive data. This tutorial will learn different approaches to strip newline characters from string in Python.…
View Post
Python String To Array
  • Basics
  • Python
  • 2 minute read

How To Convert Python String To Array

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
In Python, we do not have an in-built array data type. However, we can convert Python string to list, which can be used as an array type. Python String to…
View Post
Python Split List Into Chunks
  • Basics
  • Python
  • 3 minute read

Python Split list into chunks

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
In this tutorial, you will learn how to split a list into chunks in Python using different ways with examples. Python Split list into chunks Lists are mutable and heterogenous,…
View Post
Remove Character From String Python
  • Basics
  • Python
  • 2 minute read

Remove Character From String Python

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
We can remove a character from String in Python using replace() and translate() methods. In this tutorial, let’s look at How to remove a character from a string in Python…
View Post
Python Comment Block / Python Multiline Comment
  • Basics
  • Python
  • 3 minute read

Python Comment Block

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • September 20, 2022
Comments are a piece of text in a computer program that provides more information on the source code written. Like every other programming language, Python has three different types of…
View Post
Python Ternary Operator
  • Basics
  • Python
  • 2 minute read

Python Ternary Operator

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
Python Ternary operators also called conditional expressions, are operators that evaluate something based on a binary condition. Ternary operators provide a shorthand way to write conditional statements, which makes the…
View Post
Python Max Int Maximum Value Of Int In Python
  • Python
  • Basics
  • 2 minute read

Python Max int | Maximum value of int in Python

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
In this tutorial, we will look at what’s Python Max int in different versions of Python. Python 3 has unlimited precision that means there is no explicitly defined max limit.…
View Post
How To Append A String In Python
  • Python
  • Basics
  • 2 minute read

How to append a string in Python?

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
In this tutorial, we will see different ways to append a string in Python. The most efficient methods are using the += operator, join() function, and f-strings. We know that strings are immutable in Python,…
View Post
How To Find Square Root In Python
  • Python
  • Basics
  • 2 minute read

How to find Square Root in Python?

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
In this article, you will be learning how to find square roots in Python and what are the popular square root functions in Python. What is a Square root? Square…
View Post
How To Filter List Elements In Python
  • Python
  • Basics
  • 2 minute read

How to Filter List Elements in Python?

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
The filter() method filters the given sequence of elements with the help of a function that tests each element in the sequence to be true or not. Syntax: filter(function, sequence)…
View Post
Convert String To Float In Python
  • Python
  • Basics
  • How To
  • 2 minute read

Convert String to Float in Python

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
In this tutorial, we will take a look at how to convert string to float in Python. Convert string to float in Python Usually, in Python, the user input that…
View Post
How To Replace Characters In A String In Python
  • Python
  • Basics
  • How To
  • 1 minute read

How to replace characters in a string in Python?

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
If you are looking for replacing instances of a character in a string, Python has a built-in replace() method which does the task for you. The replace method replaces each matching occurrence…
View Post
Python Convert Bytes To String
  • Python
  • Basics
  • How To
  • 2 minute read

Python Convert Bytes to String

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
In this tutorial, we will take a look at how to convert bytes to string in Python.  We can convert bytes to string using the below methods  Using decode() method…
View Post
Python Reverse A List A Step-By-Step Tutorial
  • Python
  • Basics
  • How To
  • 2 minute read

Python Reverse a List: A Step-by-Step Tutorial

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
Reversing a list is a common requirement in any programming language. In this tutorial, we will learn the effective way to reverse a list in Python.  There are 3 ways…
View Post
How To Check And Print Python Version
  • Python
  • Basics
  • How To
  • 1 minute read

How to Check and Print Python Version?

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
In this tutorial, you will learn how to print the version of the current Python installation from the script. Print Python Version using sys Module The sys module comes as…
View Post
How To Get Hostname In Python
  • Python
  • Basics
  • How To
  • 2 minute read

How to get hostname in Python?

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
There are several ways to get a hostname in Python. The most popular and convenient way is to use the socket module, which provides the BSD socket interface. It’s available…
View Post
How To Generate A Random String Of A Given Length In Python
  • Python
  • Basics
  • How To
  • 2 minute read

How to Generate a random string of a given length in Python?

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
In Python, Generating a random string is pretty straightforward. However, there are scenarios where we need to generate a random string that includes alphanumeric characters for a strong password. There…
View Post
How To Round To Two Decimals In Python
  • Python
  • Basics
  • How To
  • 2 minute read

How to round to two decimals in Python?

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
This tutorial will learn how to round to two decimals in Python using round() and format() methods. Round to two decimals in Python When you deal with mathematical calculations in…
View Post
How To Find The Length Of List In Python
  • Python
  • Basics
  • How To
  • 2 minute read

Python List length: How to Find Length of List in Python?

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
The list in Python is a collection datatype that is ordered and mutable. Lists allow you to store multiple elements in a single variable. A list can have duplicate elements…
View Post
How To Get The Last Element Of A List In Python
  • Python
  • Basics
  • How To
  • 3 minute read

How to Get the Last Element of a List In Python

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
In this tutorial, let us look at the most efficient ways to find the last element in list in Python. What is a List in Python? The list is one…
View Post
Check If String Contains Substring
  • Python
  • Basics
  • 2 minute read

Python Check if String Contains Substring

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 22, 2022
In this tutorial, we will look at how to check if a string contains a substring in Python. A substring is a sequence of characters in a given string. Python…
View Post
Convert A List To String In Python
  • Python
  • Basics
  • How To
  • 2 minute read

Convert a list to string in Python

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
There are various scenarios where you would need to convert a list in python to a string. We will look into each of these scenarios in depth. Lists are one of…
View Post
Sort Dictionary By Value In Python
  • Python
  • Basics
  • How To
  • 3 minute read

Sort Dictionary by value in Python

  • Avatar Of Srinivas RamakrishnaSrinivas Ramakrishna
  • August 20, 2022
Dictionary in Python is an unordered collection to store data values in key:value pairs. Since Dictionaries are unordered collections, it is not possible to sort the dictionary in Python. Hence some…
View Post
  • Metrics Converter
  • Sitemap
  • Privacy Policy
  • Cookie Policy
  • Contact Us
541
98
0
0
ItsMyCode
Copyright © 2022· All Rights Reserved