Posts

Basic concepts

Image
Loops Loops are used to execute the code many times until desired. Functions They are used to encapsulate a code so it can be used again and aging. Lists Orders collection of items. Dictionaries A group of information paired Modules Files containing python codes that can be imported into your program.

Operators

Image
 Arithmetic Operator It is an operator that calculates mathematical problems like addition, subtraction, multiplication and division. Addition:- Multiplication:- Conditional operator It is an operator that has a condition which means that it has 2 choices whether yes or no. Examples are:- If and Else Elif While Relational Operator Relational operators in Python are used to compare values and are also known as comparison operators too. "==" Checks if the values are same "!=" Checks if the values are not the same ">" Checks if the value on the left is greater than the value on the right  "<"  Checks if the value on the right is greater than the value on the left "<="Checks if the left value is less or equal to the right value ">=" Checks if the right value is less or equal to the left value

Input Statement

Image
 What is an Input statement? An input statement helps us to ask about an input number or decimal number from the user. The default datatype of the input statement is String so if we want in different datatype we need to write it in the code like this. A program that calculates the Area and Perimeter of a rectangle

Comment line

Image
  What is a Comment line? Comment lines are lines that are ignored by the interpreter thus making it disappear in the outputs. This is used to give information about the code. Evolution of Python Python was made in 1989 by Guido Van Rossum at Centrum Wiskunde and Informatica (CWI) Python 2.0 was released in December with many new features like list comprehensions and cycle detecting Python 3.0 was released in 3 December 2008 with some new semantics and changed syntax Python 3.5 had added some new syntax to the language Python 3.9 is the oldest supported version of python Python 3.10 added the union type operator and the "match "and "case" keywords Python 3.11 expanded exception handling Functionality. It is also 10% and 60% faster than Python 3.10. Python 3.12 added the new keyword "type". This also adds another 5% extra faster. The Python we use till today is Python 3.15

Variables

Image
What are Variables?  Variables are names given to a computer memory location in order to store data in a program to run it. The values can be known or unknown in a program. They act like containers that become full when data is give to them. They also label the data they are holding.                                                                     Creating a Variable Creating a variable is also known as declaration of a Variable. To declare a variable we need to first tell the variable name and then tell which type of data it is holding. But some programing languages like Python, Perl, PHP, ect- don't need to specify the type of data the Variable is holding. References- V ariables in Programming Language | What are Variables? | Definition What is a Variable in Programming? - De...

Datatypes in Python

Image
What is a datatype- A datatype tells us that what kind of information is being stored in a variable. It also makes it easy to categorize the data stored.  Types of Datatypes:- Primitive Datatype- These are predefined datatypes that are independent of all other kinds and include basic values of particular attributes, like text or numeric values . They are the most fundamental type and are used as the foundation for more complex datatypes. Composite Datatypes- These datatypes are made put of various primitive kinds that are mostly supplied by the user. They are also called as non-primitive datatypes User Defined Datatypes- This datatype is derived from an existing datatype. Anyone can create their own. Examples of Datatypes:- String- Represents a sequence of characters like "House" and "863218" Integer- Represents Whole numbers like 24 and -7 Float- Represents a fractional or decimal numbers Boolean- Represents true or false option Reference- Data Types in Programming...

Difference between compiler based and interpreter based language

 Compiler based A compiled language is a type of programming language that generally is compiled or all the errors are given in on time. The program gets converted into machine language and then is runed. This also can be time consuming for large programs. Some examples of compiler based C, C++, C#, CLEO, COBOL, etc-.  Interpreter based  This language directly executes the available programs or binaries or executables without converting them to machine codes. They have only syntax and semantics analysis phases of compilation. They don't have machine code generation phase. Difference Compiler based program use less recourses than interpreter based programs. Compiler based programs consumes less resources than interpreted programs Interpreter based language in simpler to learn and use than compiler based References Difference between Compiled and Interpreted Language - GeeksforGeeks What is an Interpreter? Types, Differences, Advantages & Disadvantages I took reference ...