Author: Arpit Mandliya
- 08 December
Python tuple count()
In this post, we will see about Python tuple’s count method.Python tuple’s count method is used to count the occurrences of element in the tuple. Python tuple count syntax [crayon-67865c76b63fc294515430/] tuple1 is object of the tuple and element is the object which you want to get count. Python tuple count example Let’s understand count method […]
- 07 December
python – check if list is empty
In this post, we will see how to check if list is empty in python. It is very easy to check if list is empty in python. You can use "not" to check if list is empty in Python. Let’s understand with the help of simple example. [crayon-67865c76b67cb946279938/] Output: list1 is not empty list2 is […]
- 07 December
Python List tutorial
In this tutorial, we are going to see about Python List. Python List is one of the most used data structure in Python. Python List is a collection of items in ordered sequence.There are 6 sequences in python and List is one of them. Python list begins with an opening square bracket and ends with […]
- 17 November
Java program to print floyd’s triangle
In this post, we will see how to print Floyd’s triangle in java. Problem You need to print Floyd’s triangle as below for n=5. Floyd’s triangle **************** 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Floyd’s triangle in java Let’s create class "FloydTriangleMainExample.java" as below [crayon-67865c76b6b72064580188/] When you […]
- 17 November
Print Numbers Using Multiple Threads in Java
In this post, we will see how to print numbers using multiple threads in java.It is similar to printing odd-even numbers using two threads in java. Problem You are given 3 threads. You need to print sequence using these 3 threads.You need to print in natural order up to MAX. For example: Let’s say you […]
- 10 November
Java Format number as currency
In this post, we are going to see how to format currency in java. We can format number into Currency by using NumberFormat class.We need to call NumberFormat.getInstance() to get NumberFormat object by passing specified locale. For example: Let’s say you want a Format object for UK Locale or US Locale. You can simply use below […]
- 10 November
Java String matches example
In this post, we are going to see String’s matches method. String’s matches method String matches method is used to check whether the string is matched with the given regular expression.In normal terms, we can pass various regular expressions to check if the specified string matches with that regular expression.If the matches get successful return […]
- 10 November
Java List to String
In this post, we will see how to convert List to String in java. Following are the ways to convert list into String: Using StringBuilder We can use StringBuilder class to convert List to String. StringBuilder is the best approach if you have other than String Array, List.We can add elements in the object of […]
- 10 November
Java Convert Array to List
In this post, we will see how to convert array to list in java. There are may ways to convert array to list: By using Arrays.asList(): This is an easy method to convert Array into list.We just need to pass array as parameter to asList() method.It is a Static method available in Arrays class so, […]