python logo

Python Program for BogoSort or Permutation Sort

  BogoSort also known as permutation sort, stupid sort, slow sort, shotgun sort or monkey sort is a particularly ineffective algorithm based on generate and test paradigm. The algorithm successively generates permutations of…

Read more
python logo

Python Program to find sum of array

  Given an array of integers, find the sum of its elements. Examples : Input : arr[] = {1, 2, 3} Output : 6 1 + 2 + 3 = 6 Input :…

Read more
python logo

Python Program to find sum of array

Given an array of integers, find the sum of its elements. Examples : Input : arr[] = {1, 2, 3} Output : 6 1 + 2 + 3 = 6 Input : arr[]…

Read more
python logo

Python Program to find sum of array

Given an array of integers, find the sum of its elements. Examples : Input : arr[] = {1, 2, 3} Output : 6 1 + 2 + 3 = 6 Input : arr[]…

Read more
python logo

Remove duplicate words from Sentence using Regular Expression

Difficulty Level : Medium Last Updated : 16 Feb, 2021 Given a string str which represents a sentence, the task is to remove the duplicate words from sentences using regular expression in java. Examples: Input: str = “Good bye bye world world”…

Read more
python logo

Python Regex – Program to accept string starting with vowel

Prerequisite: Regular expression in Python Given a string, write a Python program to check whether the given string is starting with Vowel or Not. Examples: Input: animal Output: Accepted Input: zebra Output: Not…

Read more

Python Program to find largest element in an array

Given an array, find the largest element in it. Input : arr[] = {10, 20, 4} Output : 20 Input : arr[] = {20, 10, 20, 4, 100} Output : 100 Python3  …

Read more

Program to display calendar of the given month and year

  # importing calendar module import calendar yy = 2014 # year mm = 11 # month # To take month and year input from the user # yy = int(input(“Enter year: “))…

Read more

Python Program to Find ASCII Value of Character

# Python Program to find the factors of a number # This function computes the factor of the argument passed def print_factors(x): print(“The factors of”,x,”are:”) for i in range(1, x + 1): if…

Read more