Latest stories

Python Program to Solve Quadratic Equation

P

This program computes the roots of a quadratic equation when coefficients a, b and c are known. To understand this example, you should have the knowledge of following Python programming topics: WHAT IS PYTHON? THINGS TO KNOW BEFORE CODE WITH PYTHON HOW DO I GET AND INSTALL PYTHON? PYTHON PRIMITIVES – VARIABLES, BUILT-IN DATA TYPES, COMMENTS, SYNTAX, AND SEMANTICS CODING APPROACHES IN PYTHON STYLE...

Python Program to Calculate the Area of a Triangle

P

In this program, you’ll learn to calculate the area of a triangle and display it. To understand this example, you should have the knowledge of following Python programming topics: WHAT IS PYTHON? THINGS TO KNOW BEFORE CODE WITH PYTHON HOW DO I GET AND INSTALL PYTHON? PYTHON PRIMITIVES – VARIABLES, BUILT-IN DATA TYPES, COMMENTS, SYNTAX, AND SEMANTICS CODING APPROACHES IN PYTHON STYLE GUIDE...

Python Program to Print Hello world!

P

A simple program that displays “Hello, World!”. It’s often used to illustrate the syntax of the language. To understand this example, you should have the knowledge of following Python programming topics: WHAT IS PYTHON? THINGS TO KNOW BEFORE CODE WITH PYTHON HOW DO I GET AND INSTALL PYTHON? PYTHON PRIMITIVES – VARIABLES, BUILT-IN DATA TYPES, COMMENTS, SYNTAX, AND SEMANTICS CODING APPROACHES...

Python Program to Find Factors of Number

P

In this program (Python Program to Find Factors of Number), you’ll learn to find the factors of a number using a for loop and display it. To understand this example, you should have the knowledge of following Python programming topics: Python if…else Statement Python for Loop Python User-defined Functions Download an Android Application for online learning app of Study Warehouse...

Python Program to Check Prime Number

P

Example to check whether an integer is a prime number (Check Prime Number) or not using for loop and if…else statement. If the number is not prime, it’s explained in output why it is not a prime number. To understand this example, you should have the knowledge of following Python programming topics: Python if…else Statement Python for Loop Python break and continue A positive...

Python Program to Add Two Numbers

P

In this program, you will learn to add two numbers and display it using print() function. To understand this example, you should have the knowledge of following Python programming topics: Python Input, Output and Import Python Variables and Data Types Python Operators In the program below, we’ve used the arithmetic addition operator (+) to add two numbers. #This program adds two numbers...

Basic Operators in Python 3

B

In this tutorial, we discuss about the Basic Operators in Python. Operators are the constructs, which can manipulate the value of operands. Consider the expression 4 + 5 = 9. Here, 4 and 5 are called the operands and + is called the operator. Before the start discussion of Basic Operators in Python, it is always recommended you should know about Python Primitives. Follow the link below PYTHON...

Errors and Exceptions in Python

E

Hi Folks, In this tutorial, we discuss about the errors and exceptions in python language.  Errors are something that irritates and frustrate programmers at every level of experience. In Python, there are two types of code-based errors, syntax errors, and exceptions. Before start discussion, it is always recommended to know Python Primitives. Follow the link below PYTHON PRIMITIVES – VARIABLES...

Basic Python Program that counts from 1 to 10

B

Many programmers get overwhelmed when they initially approach a problem. An effective approach to help solve the problem, regardless of size, is to logically divide the problem into parts. In this tutorial, we discuss the basic python program that counts from 1 to 10. For example, let’s code program that counts from 1 to 10. Each time the count increments we want to display a new number, and to...

Style Guide for Programming Python Code

S

PEP 8 — Style-Guide for Python Code is the style guide for programming Python code. Study this. One idiom that trips up many new Python developers is indentation. Python uses indentation (4 spaces) to logically organize code into sections called code blocks. A code block starts with an indent and ends with a dedent (un-indent?). Incorrect indentation will generate an error in Python preventing...

Basics of Python