• Convert float to int in Python
    19 June

    Convert float to int in Python

    Python provides several in-built functions and modules for datatype conversions. Floating-point numbers can be easily converted to integers using some of these in-built functions. This tutorial will discuss the several methods available to convert float to int in Python. Using the int() function to convert float to int in Python The int() function in Python […]

  • Pandas convert column to int
    18 June

    Pandas convert column to int

    Pandas is a library set up on top of the Python programming language and is mostly used for the purpose of Data Analysis and Machine learning. Pandas DataFrame can be defined as two-dimensional data structures that have columns of possibly different types. In this article, we will also need to use Pandas Series. Series can […]

  • Detect keypress in Python
    12 June

    Detect keypress in Python

    Python allows us to work with user input in its programs. We can also work with hardware devices in Python. In this article, we will discuss how to detect keypress in Python. Using the keyboard module to detect keypress in Python The keyboard module is well equipped with different functions to perform operations related to […]

  • Write a list to a file in Python
    12 June

    Write a List to A File in Python

    Python allows us to work with different data structures and write them to an external file. In this tutorial, we will learn how to write a list to a file in Python. If you want write list to CSV file, you can refer write list to CSV in Python. Using the write() function to write […]

  • Copy a dictionary in Python
    12 June

    7 ways to copy a dictionary in python

    💡 Outline **Shallow copy** You can use copy method of Dictionary to create shallow copy of dictionary in Python. [crayon-678b376ad72c2877348057/] **Deep copy** You can use deepcopy() function of copy module to create deep copy of dictionary in Python. Dictionaries are a mutable structure in Python. We can alter the key-value pairs in a dictionary without […]

  • Escape quotes in Python
    11 June

    Escape quotes in Python

    💡 Outline You can use \ to escape quotes in Python. If you want to delay python program by 500 ms, then you need to pass 0.5 as parameter to sleep method. [crayon-678b376ad73fb949509829/] Escape sequences are frequently used in programming. They are used to convey to the compiler that the escape character has some other […]

  • Merge two vectors in C++
    11 June

    Merge two Vectors in C++

    vectors are like dynamic arrays and they can be resized when an element is added or deleted. Their storage is handled automatically by the container. C++ allows multiple features which can help in merging two vectors efficiently. In this article, we will discuss six different ways to merge two vectors in C++. Using merge() to […]

  • C++ random number between 0 and 1
    11 June

    Generate Random Number Between 0 and 1 in C++

    1. Introduction Generating random numbers within a specific range is a common task in C++ programming. The requirement often involves creating random integers or floating-point numbers within a range, like 1 to 10. This article will explore various methods to generate random numbers between 0 and 1(inclusive and exclusive both) The numbers generated are fractions, […]

  • public static void main(String args[]) - Java main method
    11 June

    public static void main(String[] args) – Java main method

    If you have worked with Java programs before, you know that all Java programs start by running the main() method(public static void main(String[] args)). The main() method is the entry point. The signature of the main method is fixed, and each portion of the statement has significance. Why is the main method so important? The […]