Kotlin take method explanation with different examples

take() method is defined in Kotlin standard library. This method can be used with an array or iterable. In this tutorial, we will learn how to use take method in kotlin with example. The program will show you how take works on arrays with a different data type.

Read

Two ways to find the set difference in Python

In this python programming tutorial, we will learn how to find the difference between two sets. The difference between set A and set B is a set that contains only the elements from set A those are not in set B. In this example, we will take the inputs from the user for both sets. The program will calculate the difference and print it out.

Read

How to compare Substrings in Java using regionMatches

Sometimes we need to compare two substrings in different string in Java. We can do that by comparing each character one by one of both strings but Java String class comes with a built-in method called regionMatches to make this task easier.

Read

C program to count even and odd numbers in a user input array

In this C programming tutorial, we will learn how to count the odd and even numbers in an array. The program will populate the array taking inputs from the user and it will print out the even and odd count.

Read

perror function in C explanation with example

perror method of C comes in handy if you want to print an error message to the user. It shows the most recent error that was occurred before the function was called. Basically, it prints one error message to stderr. This function is defined as below :.

Read

Find the maximum of two or three values in Kotlin using maxOf function

Kotlin standard library comes with a lot of different functions derived under different packages. For example, if we want to find out the largest of two or three numbers in Kotlin, we can either write our own comparison function or use the one that is provided under the standard library.

Read

Python program to convert kilometers to miles

In this python programming tutorial, we will learn how to convert a kilometer value to miles. The program will take the kilometer input from the user, convert it and print out the result.

Read

Python program to find out the perimeter of a triangle

In this python programming tutorial, we will learn how to find out the perimeter of a triangle using user-provided values. The program will take the inputs from the user and print out the result.

Read

Python program to find out the largest divisor of a number in 3 ways

This post will show you three different ways to find the largest divisor of a number in Python. We will learn how to use a for loop or how to use the next() function to calculate the largest divisor with examples.

Read

Python program to find factors of a number

Python program to find the factors of a number. The program will take one number as the input from user and print out the factors for that number.

Read