Python

Python Examples for Beginners: Python Code to Swap Two Variables

Hits: 15 (Python Tutorials for Citizen Data Scientist) Python Code to Swap Two Variables In this example, you will learn to swap two variables by using a temporary variable and, without using temporary variable. Source Code: Using a temporary variable # Python program to swap two variables x = 5 y = 10 # To …

Python Examples for Beginners: Python Code to Solve Quadratic Equation

Hits: 14 (Python Tutorials for Citizen Data Scientist) Python Program to Solve Quadratic Equation This program computes roots of a quadratic equation when coefficients a, b and c are known. The standard form of a quadratic equation is: ax2 + bx + c = 0, where a, b and c are real numbers and a …

Python Examples for Beginners: Python Code to Calculate the Area of a Triangle

Hits: 8 (Python Tutorials for Citizen Data Scientist) Python Program to Calculate the Area of a Triangle In this program, you’ll learn to calculate the area of a triangle and display it. If a, b and c are three sides of a triangle. Then, s = (a+b+c)/2 area = √(s(s-a)*(s-b)*(s-c)) Source Code # Python Program to find the area of …

Python Examples for Beginners: Python Code to Find the Square Root

Hits: 8 (Python Tutorials for Citizen Data Scientist) Python Program to Find the Square Root In this program, you’ll learn to find the square root of a number using exponent operator and cmath module. Example: For positive numbers # Python Program to calculate the square root # Note: change this value for a different result …

Python Examples for Beginners: Python Code to Add Two Numbers

Hits: 18 (Python Tutorials for Citizen Data Scientist) Python Program to Add Two Numbers In this program, you will learn to add two numbers and display it using print() function. In the program below, we’ve used the + operator to add two numbers. Example 1: Add Two Numbers # This program adds two numbers num1 = 1.5 …

Python Examples for Beginners: Python Code to Print Hello world

Hits: 18 (Python Tutorials for Citizen Data Scientist) Python Code to Print Hello world! A simple program that displays “Hello, World!”. It’s often used to illustrate the syntax of the language. Source Code # This program prints Hello, world! print(‘Hello, world!’) Output Hello, world! In this program, we have used the built-in print() function to print the …

Python Basics for Beginners – Python | Basic Operators

Hits: 68 Python Basics for Beginners – Python | Basic Operators Operators are the constructs which can manipulate the value of operands. Consider the expression 4 + 5 = 9. Here, 4 and 5 are called operands and + is called operator. Types of Operator Python language supports the following types of operators. Arithmetic Operators …

Python Basics for Beginners – Python | Variable Types

Hits: 30 Python Basics for Beginners – Python | Variable Types Variables are nothing but reserved memory locations to store values. This means that when you create a variable you reserve some space in memory. Based on the data type of a variable, the interpreter allocates memory and decides what can be stored in the …

Python Basics for Beginners – Python | Basic Syntax

Hits: 35  Python Basics for Beginners – Python | Basic Syntax The Python language has many similarities to Perl, C, and Java. However, there are some definite differences between the languages. First Python Program Let us execute programs in different modes of programming. Interactive Mode Programming Type the following text at the Python prompt and …

Python Basics for Beginners – Python | Introduction

Hits: 49  Python Basics for Beginners – Python | Introduction   Python is a high-level, interpreted, interactive and object-oriented scripting language. Python is designed to be highly readable. It uses English keywords frequently where as other languages use punctuation, and it has fewer syntactical constructions than other languages. Python is Interpreted − Python is processed at …

Python Vs R – Which should I learn for Business Data Analytics?

Hits: 690 R Vs Python – Which should I learn for Business Data Analytics? Now, it’s the time for a battle of two most demanding programming languages that is R vs Python. We will go deep in understanding the differences between the two languages. And, I assure you that you will not have any confusion …

Python Data Visualisation for Business Analyst – How to plot Lollipop Chart in Python

Hits: 172 (Python Data Visualisation Tutorials) Python Data Visualisation for Business Analyst – How to plot Lollipop Chart in Python In this data visualisation tutorial, you will learn How to plot Lollipop Chart in Python. Lollipop chart serves a similar purpose as an ordered bar chart in a visually pleasing way.   End-to-End Applied Machine …

Python Data Visualisation for Business Analyst – How to plot Ordered Bar Chart in Python

Hits: 100 (Python Data Visualisation Tutorials) Python Data Visualisation for Business Analyst – How to plot Ordered Bar Chart in Python In this data visualisation tutorial, you will learn How to plot Ordered Bar Chart in Python. Ordered bar chart conveys the rank order of the items effectively. But adding the value of the metric …

Python Data Visualisation for Business Analyst – How to plot Area Chart in Python

Hits: 65 (Python Data Visualisation Tutorials) Python Data Visualisation for Business Analyst – How to plot Area Chart in Python In this data visualisation tutorial, you will learn How to plot Area Chart in Python. By coloring the area between the axis and the lines, the area chart throws more emphasis not just on the …

Python Data Visualisation for Business Analyst – How to plot Diverging Lollipop Chart with Markers in Python

Hits: 67 (Python Data Visualisation Tutorials) Python Data Visualisation for Business Analyst – How to plot Diverging Lollipop Chart with Markers in Python In this data visualisation tutorial, you will learn How to plot Diverging Lollipop Chart with Markers in Python. Lollipop with markers provides a flexible way of visualizing the divergence by laying emphasis …

Python Data Visualisation for Business Analyst – How to plot Diverging Dot in Python

Hits: 32 (Python Data Visualisation Tutorials) Python Data Visualisation for Business Analyst – How to plot Diverging Dot in Python In this data visualisation tutorial, you will learn How to plot Diverging Texts in Python. Diverging dot plot is also similar to the diverging bars. However compared to diverging bars, the absence of bars reduces …