• 22 October

    Binary search in C++

    This article is about binary search and its implementation in C++. What is Binary Search? The word ‘Binary’ actually refers to ‘two’. So, it’s anticipatable that there will be something related to ‘two’. In case of linear search, we start from the beginning of an array and keep checking gradually. Now, there may be cases […]

  • 22 October

    Python not equal operator

    In this post, we will see about Python not equal operator. Not equal operator is denoted by != in Python and returns true when two variables are of same type but have different value. If two variable posses same value, then not equal operator will return False. Python not equal operator example Here is simple […]

  • 21 October

    Python add to Dictionary

    In python, there are multiple ways to add keys or values to dictionary. You can use assignment operator to add key to dictionary. # Updates if ‘x’ exists, else adds ‘x’ dic[‘x’]=1 There are other ways to add to dictionay as well in python. dic.update({‘x’:1}) # OR dic.update(dict(x=1)) # OR dic.update(x=1) Example: [crayon-6788c6f04499a588196385/] Output: Before: […]

  • 21 October

    Python String compare

    In this post, we will see how to compare two Strings in Python. You don’t any specific methods to compare Strings in python. You can use different operators such == and =! for String comparison. You can also use <, >, <=, >= with Strings. Let’s understand with the help of example: [crayon-6788c6f044a27610077085/] Output: True […]

  • 21 October

    Validate email address in Python

    In this post, we will see how to validate email address in Python. There are times when you want to validate email address. You can write your own code to validate email address but there are many regular expressions which you can use to validate email address. We can use regular expression provided by OWASP […]

  • 21 October

    Remove whitespace from String Python

    In this post, we will see how to remove whitespace from String in Python. There are multiple ways to do it. Remove all whitespace from String You can use String’s replace method to remove all whitespaces from String in Python. [crayon-6788c6f044b82522527595/] Output: HelloJava2blog Remove leading and trailing whitespaces from String You can use String’s strip […]

  • 21 October

    Python Remove Character from String

    In this post, we will see how to remove character from String in Python. There are multiple ways to do it.We will see three of them over here. Using String’s replace method You can use Python String’s remove method to remove character from String. Please note that String is immutable in python, so you need […]

  • 20 October

    C Program to print even numbers from 1 to 100

    In this post, we will see how to write C Program to print even numbers from 1 to 100. This post will address below to queries: C Program to print even numbers from 1 to 100 C Program to print even numbers from 1 to n C program to print even numbers from 1 to […]

  • 19 October

    C Program to print odd numbers from 1 to 100

    In this post, we will see how to write C Program to print odd numbers from 1 to 100. This post will address below to queries: C Program to print odd numbers from 1 to 100 C Program to print odd numbers from 1 to n C program to print odd numbers from 1 to […]