Python Programs to print pyramid patterns Patterns can be printed in python using simple for loops. First outer loop is used to handle number of rows and Inner nested loop is used to handle the number of columns. Manipulating the
Tag: python-simple-programs
Python program to convert a list to stringPython program to convert a list to string
Given a list, write a Python program to convert the given list to string. There are various situation we might encounter when a list is given and we convert it to string. For example, conversion to string from the list
Python program to print all Prime numbers in an IntervalPython program to print all Prime numbers in an Interval
Given two positive integers start and end. The task is to write a Python program to print all Prime numbers in an Interval. Definition: A prime number is a natural number greater than 1 that has no positive divisors other
Python program to convert decimal to binary numberPython program to convert decimal to binary number
Given a decimal number as input, the task is to write a Python program to convert the given decimal number into equivalent binary number. Examples : Input : 7 Output :111 Input :10 Output :1010 Method #1: Recursive solution DecimalToBinary(num):
Python program to add two numbersPython program to add two numbers
Given two numbers num1 and num2. The task is to write a Python program to find the addition of these two numbers. Examples: Input: num1 = 5, num2 = 3 Output: 8 Input: num1 = 13, num2 = 6 Output:
Python program to print all odd numbers in a rangePython program to print all odd numbers in a range
Given starting and end points, write a Python program to print all odd numbers in that given range. Example: Input: start = 4, end = 15 Output: 5, 7, 9, 11, 13, 15 Input: start = 3, end = 11
Python program to check whether a number is Prime or notPython program to check whether a number is Prime or not
Given a positive integer N, The task is to write a Python program to check if the number is prime or not. Definition: A prime number is a natural number greater than 1 that has no positive divisors other than