Posts

Showing posts from July, 2020

Let Set Targets

Image
Let set Targets  You know, one of the greatest things that I fear in life and do nothing about is Oblivion. It depend on our present actions, but I hardly do anything to escape from it. At the end of the day I have be from nothing to something in life to be worthy in front of the society, or it won't respect me. JEE was a terrible phase in my life, I blame no-one except me, I messed it up very bad. I love computer science, coding and wan't to persue my career in that field. GATE-CSE-2023 is my only hope and I want to succeed. I love coding and thus wan't to peruse my career in that field. Let me stick the Gate CSE syllabus to keep me motivated.

Data types in Java ( Java Part - 2 )

Image
There are two types of programming languages : 1. Statistically Typed Language :-   There are languages where variables and expressions are already known as runtime. Here each and every variable has to be typed with it's appropriate data types and a variable with one data type can store data from the other data type. Example : C,C++,Java. 2. Dynamically Typed Language :- The languages where variable and expressions are only known during the runtime is known as dynamically typed programming languages. Here we don't have to declare each an every variable with it's corresponding data type, it has rather to be type-cast-ed to it's appropriate data types. Example :- Python, R. Java   is a strongly typed programming language. It's safety and robustness comes from that fact. Each variable and it's data type has to strictly typed. All assignments, whether explicit or via parameter passing in method calls ( function calls ), are checked for type compatibility. ...

Getting Started with Java ( Java -1 )

Java is nearly an 100% Object Oriented Programming Language. The smallest part of a java program is a function, which is always a part of any class. Some Functions return or doesn't return anything, we give a suitable return type as we give in C/C++/Python. The syntax is as below : When a function is written within a class we call it a method of that class. The name of the classes in Java are generally written in Capital letters as syntax. All the classes and method in Java has an access modifier. This access modifier determines if any user can access the method or class. Public, private, protected are some access specifier/ accees moderator. The outer class should always be Public or Default ( by not writing any class ). Here is the first program that prints "Hello World".

Pass and Continue Function in Python 3

Pass and Continue Function in Python 3 The pass function is to similar to continue function. But it doesn't take the loop to the next iteration rather is continues through all the conditions given and then goes on to the next iteration. A simple code can sum up the operation of pass function.  An example of the use of Pass Function An example of the use of Continue Function

If __name__ == '__main__' in Python 3

Image
What does If __name__ == '__main__' mean in Python ? As we know that in Python we don't have a definite main functions, we don't require it normally in a program as most programs run flawlessly. But when we are working on more than one python program files and we want to import a certain function of Python_Project 1 in Python_project 2, then  we have to declare the main function as    If __name__ == '__main__'  because if we don't do it the whole main program will run along the function we wanted to run from  Python_Project 1  in  Python_project 2.  Like in C, C++ we use a main function similarly it is a type of main function which is used when required.  We require two python files to see it's proper execution. We get the output as 10 in Project 2. See Project 1 and Project 2 we are using add function from Project 1 in Project 2 through normal importing, but we have declaired the main here. If we haven't ...

Try / Except / Else / Finally Functions in Python 3

Error Handling in Python 3 When you run a program, there are time when you experience a runtime error. These are experienced because the input might not be appropriate according to a data type or file which you may be opening does not exit or some math error occurs ( there can be several other reason for runtime errors). But the Try function in Python lets us to properly manage the error through error handling. Try keyword and except keyword are complementary to each other. If any runtime error is experienced while running the Try block the Except block is runs, where you can five a customised error message or you can even writing another alternate piece of code.

Python 3 Operators

Image
...<< Python Operators > >... Operators are used to perform operations on variables and values. Python divides the operators in the following groups: Arithmetic operators Assignment operators Comparison operators Logical operators Identity operators Membership operators Bitwise operators Python Arithmetic Operators Arithmetic operators are used with numeric values to perform common mathematical operations: Operator Name Example Try it + Addition x + y Try it » - Subtraction x - y Try it » * Multiplication x * y Try it » / Division x / y Try it » % Modulus x % y Try it » ** Exponentiation x ** y Try it » // Floor division x // y Try it » Python Assignment Operators Assignment operators are used to assign values to variables: Operator Example Same As Try it = x = 5 x = 5 Try it » += x += 3 x = x + 3 Try it » -= x -= 3 x = x - 3 Try it » *= x *= 3 x = x * 3 Try it » /= x /= 3 x = x / 3 Try it » %= x %= 3 x = x % 3 Try it » //= x ...