CategoryCode

Python Program to Check if a Number is Positive, Negative or 0

P

In this example, you will learn to check whether a number entered by the user is positive, negative or zero. This problem is solved using if…elif…else and nested if…else statement. 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...

Python Program to Convert Celsius To Fahrenheit

P

In this program, you’ll learn to convert Celsuis to Fahrenheit 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 FOR...

Python Program to Convert Kilometers to Miles

P

In this program, you’ll learn to convert kilometers to miles 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 FOR...

Python Program to Generate a Random Number

P

In this example, you will learn to generate a random number in Python. 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 FOR PROGRAMMING...

Python Program to Swap Two Variables

P

In this example, you will learn to swap two variables by using a temporary variable and, without using temporary variable. 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...

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...

Basics of Python