Tutorialspoint

Python program to check if two lists have at least one common element

Paul Richard
Answered 4m 40s ago

In this problem we use two user input list. Our task is to check that there is any common element or not. We use very simple traversing technique, traverse both the list and check the every element of first list and second list. Example Input : A = [10, ... Read More

Python program to find the number occurring odd number of times using Lambda expression and reduce function

Rishi Raj
Answered 22m 23s ago

Here given a user input positive integer array. Our task is to find out the number occurring odd number of times. Example Input : A=[2, 4, 7, 7, 4, 2, 2] Output : 2 Algorithm Step 1: Input Array element. Step 2: Write lambda expression and apply. ... Read More

Python program to check for URL in a string

Paul Richard
Answered 30m 52s ago

In this case we use re module in Python, Here we accept a string and check if the string contains ant URL in it. If the URL is present in the string then display. We use findall () method to solve this problem. Algorithm Step 1: given string as ... Read More

C++ Program to Swap Two Numbers

Samual Sam
Answered 28m 6s ago

There are two ways to create a program to swap two numbers. One involves using a temp variable and the second way does not use a third variable. These are explained in detail as follows − Program to Swap Two Numbers using temp Variable The program to swap ... Read More

C++ Program to find size of int, float, double and char in Your System

karthikeya Boyini
Answered 34m 44s ago

Data Types in C++ There are many data types in C++ but the most frequently used are int, float, double and char. Some details about these data types are as follows − int - This is used for integer data types which normally require 4 bytes of memory space. ... Read More

C++ Program to Find Quotient and Remainder

Samual Sam
Answered 41m 21s ago

Quotient and Remainder are parts of division along with dividend and divisor. The number which we divide is known as the dividend. The number which divides the dividend is known as the divisor. The result obtained after the division is known as the quotient and the number left over is ... Read More

Prefix sum array in python using the accumulate function

Paul Richard
Answered 44m 14s ago

Given an array and we have to do the prefix sum array using function.itertools.accumulate(iterable[, func]) module functions all construct and return iterators. So they should only be accessed by functions or loops that truncate the stream. Make an iterator that returns accumulated sums. Elements may be any addable type including ... Read More

C++ Program to Add Two Numbers

karthikeya Boyini
Answered 48m 8s ago

Addition is a basic arithmetic operation. The program to add two numbers performs addition of two numbers and prints their sum on screen. A program that demonstrates addition of two numbers is given as follows − Example Live Demo #include <iostream> using namespace std; int main() ... Read More

Python program to check whether two lists are circularly identical

Arushi
Answered 53m 4s ago

Here two lists are given. Our task is to check and found weather two given lists are circularly identical or not. Example Input : A = [100, 100, 10, 10, 100] B = [100, 100, 100, 10, 10] Output : True ... Read More

C++ Program To Convert Decimal Number to Binary

Samual Sam
Answered 53m 4s ago

In a computer system, the binary number is expressed in the binary numeral system while the decimal number is in the decimal numeral system. The binary number is in base 2 while the decimal number is in base 10. Examples of decimal numbers and their corresponding binary numbers are as ... Read More

C++ Program to Print Number Entered by User

karthikeya Boyini
Answered 58m 28s ago

The objects “cin” and “cout” are used in C++ for input and output respectively. cin is an instance of the istream class and is attached to the standard input device such as the keyboard. cout is an instance of the ostream class and is connected to the standard output device ... Read More

C++ Program to Check Whether a Number is Prime or Not

Samual Sam
Answered 1h 1m ago

A prime number is a whole number that is greater than one and the only factors of a prime number should be one and itself. Some of the first prime numbers are − 2, 3, 5, 7, 11, 13 ,17 The program to check if a ... Read More

Python program to convert a list of tuples into Dictionary

Arushi
Answered 1h 8m ago

Here one tuple is given, our task is to convert tuples to dictionary. To solve this problem we use the dictionary method setdefault (). This method has two parameter, to convert the first parameter to key and the second to the value of the dictionary. Setdefault (key, value) is a ... Read More

C++ Program to Display Factors of a Number

karthikeya Boyini
Answered 1h 12m ago

Factors are those numbers that are multiplied to get a number. For example: 5 and 3 are factors of 15 as 5*3=15. Similarly other factors of 15 are 1 and 15 as 15*1=15. The program to display the factors of a number are given as follows. Example Live ... Read More

Python Program to print unique values from a list

Rishi Raj
Answered 1h 18m ago

Given a list, our task is to print all the unique numbers. Example Input:A = [1, 2, 3, 4, 2, 1, 9] Unique list is [1, 2, 3, 4, 9] Algorithm Step 1: Create user input list. Step 2: Create an empty list. Step 3: Traverse ... Read More

1 2 3 4 5 6 7 ... 784 Next
Advertisements
Loading...
Unanswered Questions View All