Skip to content
Code_Underscored_logo
  • Python
  • Django
  • Web Development
  • Machine Learning
  • C++
  • Java
Code_Underscored_logo
  • print a newline in Python
    Python

    How to print a newline in Python

    ByHumphrey June 28, 2022March 2, 2024

    In Python, the new line character indicates a line’s end and a new one’s start. If you wish to print output to the console and work with files, you’ll need to know how to use it.

    Read More How to print a newline in PythonContinue

  • Python Defaultdict
    Python

    Python Defaultdict explained with examples

    ByHumphrey June 28, 2022March 2, 2024

    In Python, a dictionary represents an unordered collection of data values that can be used to store data values in the same way a map can. The dictionary has a key-value pair, unlike other data types with a single value as an element. The key must be unique and unchanging, according to Dictionary. It means that a Python Tuple, unlike a Python List, can be used as a key.

    Read More Python Defaultdict explained with examplesContinue

  • Stack and Queue in Java
    Java

    Stack and Queue in Java with examples

    ByLucy June 23, 2022March 2, 2024

    Consider a table with a stack of plates. After the first one is placed on the table, the next one is placed on top of it; the third one is placed on top of the second, and so on, until the desired number is reached. To take the dishes off the table one by one, start with the last one placed on top; then move on to the last-but-one; then the one next to the top; and so on.

    Read More Stack and Queue in Java with examplesContinue

  • StringBuilder in Java
    Java

    StringBuilder in Java explained with examples

    ByLucy June 23, 2022March 2, 2024

    StringBuilder is a Java class that allows you to generate a mutable, or changeable, sequence of characters. The StringBuilder class, like StringBuffer, is an alternative to the Java Strings class, which provides an immutable sequence of characters. However, there is a critical distinction between StringBuffer and StringBuilder: the latter is non-synchronized.

    Read More StringBuilder in Java explained with examplesContinue

  • Using the Python Double Slash
    Python

    How to use Python Double Slash

    ByHumphrey June 23, 2022March 2, 2024

    Let’s face it: There are many different ways to use Python in your coding projects. And that’s not going away anytime soon. As developers increasingly adopt Python, we see more and more opportunities to incorporate it into our coding projects. How do you make sure you’re using it optimally?

    Read More How to use Python Double SlashContinue

  • Factorial in Python NumPy
    Python

    Factorial in Python NumPy explained with examples

    ByHumphrey June 20, 2022March 2, 2024

    The factorial of a positive number is computed using Python’s Numpy.math.factorial() method. But first, let’s define the term “factorial.” The numbers’ factorial o is the product of all positive non-zero numbers that are less than or equal. The general formula for computing the factorial of a number ‘n’ is as follows.

    Read More Factorial in Python NumPy explained with examplesContinue

  • use scanner in Java
    Java

    How to use scanner in Java

    ByLucy June 20, 2022March 2, 2024

    The Scanner is a class in java.util package. This class is responsible for reading data from a string, the keyboard, a file, or a network socket. This article focuses solely on reading the keyboard input and displaying the output in a terminal window. Reading data from a file or a network channel is done similarly.

    Read More How to use scanner in JavaContinue

  • Switch statement in Java
    Java

    Switch statement in Java explained with examples

    ByLucy June 20, 2022March 2, 2024

    With the help of examples, you will learn how to utilize the switch statement in Java to regulate the flow of your program’s execution. The switch statement lets us choose several different ways to run a code block. The switch statement in Java has the following syntax:

    Read More Switch statement in Java explained with examplesContinue

  • Math.random method in Java
    Java

    How to use Math.random() method in Java

    ByLucy June 20, 2022March 2, 2024

    The Math.random() method is one of Java’s most commonly used methods for generating a random numeric number. The java.lang class is a built-in class in Java.Math with several mathematical procedures, one of which is Math.random(). Because the Math.random() method is a static method, it can be invoked/called without first constructing a math class instance—the java.lang.Math class offers several methods for performing basic numeric operations such as the exponential, logarithm, square root, and trigonometric functions.

    Read More How to use Math.random() method in JavaContinue

  • _Calculating the Absolute Value in Python
    Python

    How to calculate the Absolute Value in Python

    ByHumphrey May 31, 2022March 2, 2024

    There are numerous ways to interact with positive and negative values in Python. But sometimes, all we need to do is double-check that our value isn’t negative. Let’s look at how absolute value can help.

    Read More How to calculate the Absolute Value in PythonContinue

  • Python Absolute Value with examples
    Python

    Python Absolute Value with examples

    ByHumphrey May 31, 2022March 2, 2024

    The abs() function in Python returns a number’s absolute value. The gap between an integer and zero is its absolute value. Any negative number becomes positive, whereas positive ones remain unchanged. For instance, abs(-9) returns 9, whereas abs(2) returns 2.

    Read More Python Absolute Value with examplesContinue

  • Formatting a Date to String in Java
    Java

    How to format a Date to String in Java

    ByLucy May 31, 2022March 2, 2024

    Changing the date format of a given Date or String is a typical Java programming task. For example, suppose you have “2022-05-22 12:00:00” and want to convert it to “2022-05-22,” or convert from dd-MM-YY to MM-dd-YY, or any other format you like, as long as it is a valid date format as defined by Java. How will you accomplish this? It’s not that difficult, after all. It’s a simple two-step procedure.

    Read More How to format a Date to String in JavaContinue

Page navigation

Previous PagePrevious 1 … 4 5 6 7 8 … 32 Next PageNext
  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy

© 2025 Code Underscored. All Rights Reserved.

A PART OF VIBRANT LEAF MEDIA COMPANY.

  • Python
  • Django
  • Web Development
  • Machine Learning
  • C++
  • Java
Search