python logo

10. Python program to print the smallest element in an array

In this program, we need to find out the smallest element present in the array. This can be achieved by maintaining a variable min which initially will hold the value of the first…

Read more

10. Python program to print the smallest element in an array

In this program, we need to find out the smallest element present in the array. This can be achieved by maintaining a variable min which initially will hold the value of the first…

Read more

Python program to print the elements of an array present on even position

In this program, we need to print the element which is present on even position. Even positioned element can be found by traversing the array and incrementing the value of i by 2….

Read more
python logo

Python Function to Display Calendar

In Python, we can display the calendar of any month of any year by importing the calendar module. See this example: # First import the calendar module import calendar # ask of month and year yy = int(input(“Enter year: “)) mm = int(input(“Enter month: “)) # display the calendar print(calendar.month(yy,mm)) Output:  

Read more
python logo

Python program to copy all elements of one array into another array

In this program, we need to copy all the elements of one array into another. This can be accomplished by looping through the first array and store the elements of the first array…

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