Posts

Java - Tips - 01

How do you determine the size of primitive data types in JAVA? sizeof() operator in C is used to determine the size of its operand (memory (RAM) required)  In JAVA, there is no sizeof() operator as in C Wrapper classes:   It provides a way to use primitive data typesas objects  Byte, Short, Integer, Long, Float, Double, Character and Boolean are the wrapper classes for the primitive data types byte, short, int, long, float, double, char and boolean respectively Except for the Boolean wrapper class, all other classes have SIZE and BYTES attributes The SIZE attribute determines the size of the data type in bits whereas, the BYTES returns the size of the datatype in bytes. Example: class DetermineSize  {        public static void main(String args[])       {                 System.out.println("size of byte (in bits)="+Byte.SIZE+" bits");        ...

Python Tips - 03

Image
PYTHON - OFFICIAL WEBSITE, LATEST VERSION, REQUIREMENTS AND INSTALLATION www.python.org is the official website address for PYTHON Python 3.10.4 is the latest version and it was introduced on March 24th 2022 Python 3.9+ versions cannot be used with Windows 7 or earlier versions. INSTALLATION OF PYTHON 3.10.4

Python Tips - 02

What is the output of the print(x) statements in the below example? >>>x = set(("apple","banana","cherry")) >>>print(x) >>>x.add("orange") # adds a single element >>>print(x) >>>x.update(["pine apple", "mango", "grapes"]) # iterates over the sequence and adds elements in the sequence >>>print(x) output {'cherry', 'banana', 'apple'} {'cherry', 'banana', 'orange', 'apple'} {'orange', 'apple', 'pine apple', 'banana', 'grapes', 'cherry', 'mango'} Why the elements are not printed in specific order???? ANS:  set is an unordered collection of elements  set is mutable, iterable  set does not contain duplicate elements order of elements in a set is undefined

C Puzzle - 02

 What is the output of the following C program? #include <stdio.h> void main() { int a=25,b=4; printf("%d",(a%b)); } OUTPUT: 1 % operator gives you the remainder of an integer division.

Python Tips - 01

Data Visualization  It is an extremely important part of Data Analysis Top 8 Python Libraries for Data Visualization 1. Matplotlib 2. Plotly 3. Seaborn 4. GGPlot 5. Altair 6. Bokeh 7. Pygal 8. Geoplotlib

C Puzzle

What is the output of the following code snippet? #include <stdio.h> void main(){ printf("%d",(12%2)); } Output: 0 Explanation: % is the mod operator in c, which is used to find remainder of an integer division.