Home »
Python »
Python Programs
Python Basic Programs
This section contains Python basic programs, demonstrating the examples on basic concepts such as conditional statement, control statement, small project programs, etc.
List of Python Basic Programs
- Python Program to Print Hello World
- How to print spaces in Python?
- Python | Printing different messages by using different variations of print() method
- Python program to print given text using a user-defined method
- Python | Printing different values (integer, float, string, Boolean)
- Python | Declare different types of variables, print their values, types and Ids
- Python program to demonstrate variables scope
- Determine the type of an object in Python
- Create number variables (int, float and complex) and print their types and values in Python
- Create integer variable by assigning binary value in Python
- Create integer variable by assigning octal value in Python
- Create integer variable by assigning hexadecimal value in Python
- Python | Typecasting Input to Integer, Float
- How to check multiple variables against a value in Python?
- Python program to define an integer value and print it
- Python | Input two integers and find their addition
- Python program to find sum of two numbers
- Different Methods for Adding Two Numbers in Python
- Python Arithmetic Operators: Usage, Types, and Example
- Python program to find maximum of two numbers
- Python program to find the area and perimeter of a circle
- Python program to find ASCII value of a character
- Simple Interest Program in Python
- Python program for compound interest
- Python program to check the given year is a leap year or not
- Simple pattern printing programs in Python
- Check a given number is a Fibonacci term or not in Python
- Find Power of a Number using Exponential (**) Operator in Python
- Python program to find the power of a number using loop
- Python program to find the power of a number using recursion
- Extract and print digits in reverse order of a number in Python
- Reverse Number Program in Python
- Python program to find floor division
- Python if, if...else Statement Examples
- Python | Input age and check eligibility for voting
- Python | Find largest of three number using nested if else
- Python | Calculate discount based on the sale amount
- Percentage Discount Calculator in Python
- Ternary Operator Program in Python
- Python | Design a simple calculator using if elif (just like switch case)
- For Loop Program in Python
- For Each Loop Example in Python
- Python | Examples of Loops Based on Control Type
- Python Looping Example Programs
- How to Break a Loop in Python?
- How to End Current Iteration, and Continues to Next in Python Loops?
- What is the Pass Statement in Python for Loop?
- Python | Program to print numbers from N to 1 (use range() with reverse order)
- Python | Print all numbers between 1 to 1000 which are divisible by 7 and must not be divisible by 5
- Python | Calculate square of a given number (3 different ways)
- Python | Find factorial of a given number (2 different ways)
- Python | Find the factorial of a number using recursion
- Find Square and Cube of a Number in Python
- Python | Declare any variable without assigning any value
- BMI (Body Mass Index) Calculator in Python
- Find Odd and Even Numbers from the List of Integers in Python
- Python | Program to print Palindrome numbers from the given list
- Bank Management System Program in Python
- Python | Count total number of bits in a number
- Python | Generate Random Numbers Using NumPy Library
- Generate random integers between 0 and 9 in Python
- Python Program for n-th Fibonacci Number
- Python program for sum of square of first N natural numbers
- Python program for sum of cube of first N natural numbers
- Python program to check prime number
- Python program to find the largest prime factor of a number
- Python Program for Sieve of Eratosthenes
- Python program to count prime numbers up to N (Different Methods)
- Python program to print all prime numbers in an interval
- Python program to print all positive or negative numbers in a range
- Python program for not None test
- Python program for pass statement
- Python program for Zip, Zap and Zoom game
- Python program to convert temperature from Celsius to Fahrenheit and vice-versa
- Python program to find the number of required bits to represent a number in O(1) complexity
- Python program to count number of trailing zeros in Factorial of number N
- Python program for swapping the value of two integers
- Python program for swapping the value of two integers without third variable
- Python program to find winner of the day
- Python program for Tower of Hanoi
- Python program to find standard deviation
- Python program to find the variance
- Python program Tower of Hanoi (modified)
- Python program to convert Centimeter to Inches
- Python program to convert meters into yards
- Python program to convert yards into meters
- Python program to capitalize the character without using a function
- Python program to lowercase the character without using a function
- Python program to find perfect number
- Python program to print perfect numbers from the given list of integers
- Python program to find greatest integer using floor() method
- Python program to find the maximum EVEN number
- Python program to find the maximum ODD number
- Python program to find the solution of a special sum series
- Python | Convert the binary number to decimal without using library function
- Python | Convert the decimal number to binary without using library function
- Create a stopwatch using Python
- Python program to find the maximum multiple from given N numbers
- Python program to find the least multiple from given N numbers
- Find the roots of the quadratic equation in Python
- Python program to check the given Date is valid or not
- Python program to print the calendar of any year
- Find all Prime numbers less than or equal to N using the Sieve of Eratosthenes algorithm in Python
- Find the sum of all prime numbers in Python
- Print the all uppercase and lowercase alphabets in Python
- Find the N-th number which is both square and a cube of a number in Python
- Program to find the execution time of a program in Python
- Program to find the x-intercept and y-intercept of a line passing through the given point in Python
- Find the day of the week for a given date in the past or future in Python
- Find the number of integers from 1 to n which contains digits 0's in Python
- Check whether a number is a power of another number or not in Python
- Check whether the binary representation of a given number is a palindrome or not in Python
- Draw a pie chart that shows our daily activity in Python
- Find the sum of all numbers below 1000 which are multiples of 3 or 5 in Python
- Python | How can I force division to be floating point? Division keeps rounding down to 0?
- Python program to declare a function and call it
- Python program to call a function before declaring it - Is it possible?
- Python program to call a function using keyword argument
- Python program to pass function as an argument
- Python program for passing multiple arguments to a function
- Python program to call methods from main() method
- Python program to return function from another function
- Python program to pass parameters to a function
- Create a function to check EVEN or ODD in Python
- Create a function to return the absolute the given value in Python
- Python program to define an empty function using pass statement
- Python program to design a dice throw function
- Python program to design a biased dice throw function
- Python program to design a biased coin flip function
- Python program to design a coin flip function
- Python program to print the list of all keywords
- Python program to print the version information
- Python program to find sum of all digits of a number
- Print number with commas as thousands separators in Python
- Python program to demonstrate logical errors
- Python program to print table of number entered by user
- Python program to calculate currency notes required to get the amount
- Python program to calculate discount based on selling price
- Python program to calculate gross pay (Hourly paid employee)
- Python program to get employee details and search for record by ID, surName or Designation
- Python program for Basic Shop Management System
- Python program to import modules – different Methods