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

  1. How to print spaces in Python?
  2. Python | Printing different messages by using different variations of print() method.
  3. Python program to print given text using a user-defined method
  4. Python | Printing different values (integer, float, string, Boolean).
  5. Python | Declare different types of variables, print their values, types and Ids.
  6. Python program to demonstrate variables scope
  7. Determine the type of an object in Python
  8. Create number variables (int, float and complex) and print their types and values in Python
  9. Create integer variable by assigning binary value in Python
  10. Create integer variable by assigning octal value in Python
  11. Create integer variable by assigning hexadecimal value in Python
  12. Python | Typecasting Input to Integer, Float.
  13. How to check multiple variables against a value in Python?
  14. Python | Program to define an integer value and print it.
  15. Python | Input two integers and find their addition.
  16. Python program to find sum of two numbers
  17. Python program to find addition of two numbers (4 different ways)
  18. Python Arithmetic Operators Example
  19. Python program to find maximum of two numbers
  20. Python program to find the area and perimeter of a circle
  21. Python program to print ASCII value of a character
  22. Python program for simple interest
  23. Python program for compound interest
  24. Python program to check the given year is a leap year or not
  25. Simple pattern printing programs in Python
  26. Python program to check whether a given number is a Fibonacci number or not
  27. Python program to find power of a number using exponential operator
  28. Python program to find the power of a number using loop
  29. Python program to find the power of a number using recursion
  30. Python program to extract and print digits in reverse order of a number
  31. Python program to reverse a given number (2 different ways)
  32. Python program to find floor division
  33. Python | Some of the examples of simple if else.
  34. Python | Input age and check eligibility for voting.
  35. Python | Find largest of three number using nested if else.
  36. Python | Calculate discount based on the sale amount.
  37. Python | Calculate discount based on the sale amount using Nested if else.
  38. Python | Example of Ternary Operator
  39. Python | Design a simple calculator using if elif (just like switch case)
  40. Python | Demonstrate an example of for loop
  41. Python | Demonstrate an example of for each loop
  42. Python | Examples of loops (based on their control)
  43. Python | Some of the Examples of loops
  44. Python | Demonstrate an Example of break statement
  45. Python | Demonstrate an Example of continue statement
  46. Python | Demonstrate an Example of pass statement
  47. Python | Program to print numbers from N to 1 (use range() with reverse order).
  48. Python | Print all numbers between 1 to 1000 which are divisible by 7 and must not be divisible by 5.
  49. Python | Calculate square of a given number (3 different ways).
  50. Python | Find factorial of a given number (2 different ways).
  51. Python | Find the factorial of a number using recursion
  52. Python | Declare any variable without assigning any value.
  53. Python | BMI (Body Mass Index) calculator.
  54. Python | Program to print Odd and Even numbers from the list of integers.
  55. Python | Program to print Palindrome numbers from the given list.
  56. Python | Compute the net amount of a bank account based on the transactions.
  57. Python | Count total number of bits in a number.
  58. Python | Generate random number using numpy library.
  59. Generate random integers between 0 and 9 in Python
  60. Python | Program to calculate n-th term of a Fibonacci Series
  61. Python program for sum of square of first N natural numbers
  62. Python program for sum of cube of first N natural numbers
  63. Python program to check prime number
  64. Python program to find the largest prime factor of a number
  65. Python program to find prime numbers using sieve of Eratosthenes
  66. Python program to calculate prime numbers (using different algorithms) upto n
  67. Python program to print all prime numbers in an interval
  68. Python program to print all positive or negative numbers in a range
  69. Python program for not None test
  70. Python program for pass statement
  71. Python program for Zip, Zap and Zoom game
  72. Python program to convert temperature from Celsius to Fahrenheit and vice-versa
  73. Python program to find the number of required bits to represent a number in O(1) complexity
  74. Python program to count number of trailing zeros in Factorial of number N
  75. Python program for swapping the value of two integers
  76. Python program for swapping the value of two integers without third variable
  77. Python program to find winner of the day
  78. Python program for Tower of Hanoi
  79. Python program to find standard deviation
  80. Python program to find the variance
  81. Python program Tower of Hanoi (modified)
  82. Python program to convert Centimeter to Inches
  83. Python program to convert meters into yards
  84. Python program to convert yards into meters
  85. Python program to capitalize the character without using a function
  86. Python program to lowercase the character without using a function
  87. Python program to find perfect number
  88. Python program to print perfect numbers from the given list of integers
  89. Python program to find greatest integer using floor() method
  90. Python program to find the maximum EVEN number
  91. Python program to find the maximum ODD number
  92. Python program to find the solution of a special sum series
  93. Python | Convert the binary number to decimal without using library function
  94. Python | Convert the decimal number to binary without using library function
  95. Create a stopwatch using Python
  96. Python program to find the maximum multiple from given N numbers
  97. Python program to find the least multiple from given N numbers
  98. Find the root of the quadratic equation in Python
  99. Python program to check the given Date is valid or not
  100. Python program to print the calendar of any year
  101. Find all Prime numbers less than or equal to N using the Sieve of Eratosthenes algorithm in Python
  102. Find the sum of all prime numbers in Python
  103. Print the all uppercase and lowercase alphabets in Python
  104. Find the N-th number which is both square and a cube of a number in Python
  105. Program to find the execution time of a program in Python
  106. Program to find the x-intercept and y-intercept of a line passing through the given point in Python
  107. Find the day of the week for a given date in the past or future in Python
  108. Python program to find the GCD of the array
  109. Python program to find the LCM of the array elements
  110. Find the number of integers from 1 to n which contains digits 0's in Python
  111. Check whether a number is a power of another number or not in Python
  112. Check whether the binary representation of a given number is a palindrome or not in Python
  113. Draw a pie chart that shows our daily activity in Python
  114. Find the sum of all numbers below 1000 which are multiples of 3 or 5 in Python
  115. Python | How can I force division to be floating point? Division keeps rounding down to 0?
  116. Python program to declare a function and call it
  117. Python program to call a function before declaring it - Is it possible?
  118. Python program to call a function using keyword argument
  119. Python program to pass function as an argument
  120. Python program for passing multiple arguments to a function
  121. Python program to call methods from main() method
  122. Python program to return function from another function
  123. Python program to pass parameters to a function
  124. Create a function to check EVEN or ODD in Python
  125. Create a function to return the absolute the given value in Python
  126. Python | Write functions to find square and cube of a given number.
  127. Python program to define an empty function using pass statement
  128. Python program to design a dice throw function
  129. Python program to design a biased dice throw function
  130. Python program to design a biased coin flip function
  131. Python program to design a coin flip function
  132. Python program to print the list of all keywords
  133. Python program to print the version information
  134. Python program to find sum of all digits of a number
  135. Print number with commas as thousands separators in Python
  136. Python program to demonstrate logical errors
  137. Python program to print table of number entered by user
  138. Python program to calculate currency notes required to get the amount
  139. Python program to calculate discount based on selling price
  140. Python program to calculate gross pay (Hourly paid employee)
  141. Python program to get employee details and search for record by ID, surName or Designation
  142. Python program for Basic Shop Management System
  143. Python program to import modules – different Methods




Comments and Discussions




Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.