Handling missing keys in Python dictionaries

karthikeya Boyini
Published on 25-Aug-2019 20:57:43
In Python there is one container called the Dictionary. In the dictionaries, we can map keys to its value. Using dictionary the values can be accessed in constant time. But when the given keys are not present, it may occur some errors. In this section we will see how to ... Read More

JSON Formatting in Python

Samual Sam
Published on 25-Aug-2019 20:57:43
The JSON (Java Script Object Notation) is light weight, well accepted data interchange format. Using JSON formatting techniques in Python, we can convert JSON strings to Python objects, and also convert Python Objects to JSON strings. To use these functionalities, we need to use the json module of Python. The ... Read More

Type Conversion in Python

Samual Sam
Published on 25-Aug-2019 20:57:43
Using Python, we can easily convert data into different types. There are different functions for Type Conversion. We can convert string type objects to numeric values, perform conversion between different container types etc. In this section we will see how the conversions can be done using Python. Converting String to ... Read More

Operator Functions in Python

karthikeya Boyini
Published on 25-Aug-2019 20:57:43
In Python there are some additional standard library methods for mathematical operations, like arithmetic, logical, relational, bitwise etc. operations. These methods can be found under the operator module. To use it at first we need to import it the operator standard library module. import operator In this section ... Read More

Merge two sorted arrays in Python using heapq?

Samual Sam
Published on 25-Aug-2019 20:57:43
In this section we will see how two sorted lists can be merged using the heapq module in Python. As an example, if list1 = [10, 20, 30, 40] and list2 = [100, 200, 300, 400, 500], then after merging it will return list3 = [10, 20, 30, 40, 100, ... Read More

Creating child process using fork() in Python

karthikeya Boyini
Published on 25-Aug-2019 20:57:43
Our task is to create a child process and display process id of both parent and child process using fork() function in Python. When we use fork(), it creates a copy of itself, it is a very important aspect of LINUX, UNIX. fork() is mainly applicable for multithreading environment that ... Read More

Determine if a String is a legal Java Identifier

karthikeya Boyini
Published on 25-Aug-2019 20:57:43
To determine if a String is a legal Java Identifier, use the Character.isJavaIdentifierPart() and Character.isJavaIdentifierStart() methods. Character.isJavaIdentifierPart() The java.lang.Character.isJavaIdentifierPart() determines if the character (Unicode code point) may be part of a Java identifier as other than the first character. A character may be part of a Java identifier if any ... Read More

Java Program to compare two Java char Arrays

Samual Sam
Published on 25-Aug-2019 20:57:43
To compare two Java char arrays, use the Arrays.equals() method. Let us first declare and initialize some char arrays. char[] arr1 = new char[] { 'p', 'q', 'r' }; char[] arr2 = new char[] { 'p', 'r', 's' }; char[] arr3 = new char[] { 'p', 'q', 'r' }; ... Read More

Convert string to char array in Java

karthikeya Boyini
Published on 25-Aug-2019 20:57:43
The following is our string. String str = "Tutorial"; Now, use the toCharArray() method to convert string to char array. char[] ch = str.toCharArray(); Now let us see the complete example. Example Live Demo public class Demo { public static void ... Read More

Java Program to determine a Character's Unicode Block

Samual Sam
Published on 25-Aug-2019 20:57:43
To determine a Character’s Unicode Block, use the Character.UnicodeBlock.of() method in Java. The method returns the object representing the Unicode block containing the given character, or null if the character is not a member of a defined block. Let us see the syntax of Character.UnicodeBlock.of() method. Character.UnicodeBlock of(char c) ... Read More
Advertisements