abc
abc
Computer programming is the process of writing instructions, or code, that tells a computer,
application, or software program how to perform specific actions. Programmers use programming
languages to write, test, revise, and update code.
Some of the most popular programming languages include: JavaScript, HTML/CSS, SQL, Python, and
TypeScript.
Computer programmers work across industries, including: finance, insurance, manufacturing, and
tech.
• Data scientist
• Data analyst
• Project manager
• Product manager
• Data engineer
• Cybersecurity analyst
The lowest-level programming language, which is made up of bits and is easier for computers to
understand than programmers
A language that uses stored data to perform recursive functions. Examples include Agda, Cuneiform,
PureScript, and APL
A language that treats a program as a group of objects, each with its own properties and
methods. Examples include Java, Python, PHP, and C++
Other types of programming languages include: Assembly language, Scripting languages, and Logic
programming language.
JavaScript, Python, HTML, CSS, Java, SQL, NoSQL, C#, SCALA, and R.
What is translator ?
A translator is a computer program that converts source code into object code, which is a form that
a computer can understand and execute. Translators are also known as language processors
1. Compiler
The language processor that reads the complete source program written in high-level language as a
whole in one go and translates it into an equivalent program in machine language is called a
Compiler. Example: C, C++, C#.
In a compiler, the source code is translated to object code successfully if it is free of errors. The
compiler specifies the errors at the end of the compilation with line numbers when there are any
errors in the source code. The errors must be removed before the compiler can successfully
recompile the source code again the object program can be executed number of times without
translating it again.
2. Assembler
The Assembler is used to translate the program written in Assembly language into machine code. The
source program is an input of an assembler that contains assembly language instructions. The
output generated by the assembler is the object code or machine code understandable by the
computer. Assembler is basically the 1st interface that is able to communicate humans with the
machine. We need an assembler to fill the gap between human and machine so that they can
communicate with each other. code written in assembly language is some sort of
mnemonics(instructions) like ADD, MUL, MUX, SUB, DIV, MOV and so on. and the assembler is
basically able to convert these mnemonics in binary code. Here, these mnemonics also depend
upon the architecture of the machine.
For example, the architecture of intel 8085 and intel 8086 are different.
3. Interpreter
The translation of a single statement of the source program into machine code is done by a language
processor and executes immediately before moving on to the next line is called an interpreter. If there
is an error in the statement, the interpreter terminates its translating process at that statement and
displays an error message. The interpreter moves on to the next line for execution only after the
removal of the error. An Interpreter directly executes instructions written in a programming
or scripting language without previously converting them to an object code or machine code. An
interpreter translates one line at a time and then executes it.
• Open source: Python is free and open source, including its source code.:-
Python is open source because it's developed under an OSI-approved license that
allows it to be:
• Freely used and distributed: Python is free to use for personal or commercial purposes,
without any licensing fees.
• Publicly available: The source code for Python is open and accessible to the public.
What is IDE ?
An IDE (Integrated Development Environment) is a software application that
helps developers write, debug, and test code for Python:
Features of IDE
• Code analysis
• Graphical debugger
• Autocompletion
• Features
• Flexibility
Notebooks can be run cell by cell, and users can configure workflows to suit
their needs. They can also be converted to a number of standard output
formats, including HTML, PDF, and PowerPoint.
• Sharing
Notebooks can be shared with others using email, Dropbox, GitHub, or the
Jupyter Notebook Viewer.
• Open source
Jupyter Notebook is a fully open-source product, and users can use all of its
functionality for free.
Data types in python
Python has the following data types built-in by default, in these categories:
Text Str
Type:
Mapping Dict
Type:
Boolean Bool
Type:
2. Float:- Numbers with a decimal point or numbers written in exponential form, e.g., 3.14
3. Str:- strings are used for representing textual data. A string is a sequence of characters
enclosed in either single quotes ('') or double quotes (“”)
4. Dictionary :- built-in dictionary data type to create a Python dictionary. This type stores
all kinds of data, from integers to strings to lists. The dictionary data type is similar to a
list but uses keys instead of indexes to look up values. You use the dict() function in
Python to create a dictionary.
5 Complex:- The complex data type in python consists of two values, the first one is the
real part of the complex number, and the second one is the imaginary part of the complex
number. We usually denote the real part using i and the imaginary part with j. For example,
(3 + 7j)
6. Boolean:- The boolean data type is either True or False. In Python, boolean variables
are defined by the True and False keywords.
7. List :- List is a collection of things, enclosed in [ ] and separated by commas. The list
is a sequence data type which is used to store the collection of data.
8. Tuple:- Python tuples are a type of data structure that is very similar to lists. The main
difference between the two is that tuples are immutable, meaning they cannot be changed
once they are created.
9. Set :- Set is a data type in python used to store several items in a single variable. It is
one of the four built-in data types (List, Dictionary, Tuple, and Set) having qualities and
usage different from the other three. It is a collection that is written with curly brackets and
is both unindexed and unordered.
Python Operators
1. Arithmetic Operators
2. Comparison Operators
3. Logical Operators
4. Assignment Operators
Arithmetic operators are used with numeric values to perform common mathematical
operations:
+ Addition x+y
- Subtraction x-y
* Multiplication x*y
/ Division x/y
% Modulus x%y
** Exponentiation x ** y
= x=5 x=5
+= x += 3 x=x+3
-= x -= 3 x=x-3
*= x *= 3 x=x*3
/= x /= 3 x=x/3
%= x %= 3 x=x%3
//= x //= 3 x = x // 3
**= x **= 3 x = x ** 3
Python Comparison Operators
Comparison operators are used to compare two values:
== Equal x == y
!= Not equal x != y
and Returns True if both statements are true x < 5 and x < 10