0% found this document useful (0 votes)
6 views

abc

The document provides an overview of computer programming languages, detailing various types such as procedural, object-oriented, and scripting languages, along with popular examples like Python and JavaScript. It explains the role of translators, including compilers, assemblers, and interpreters, in converting source code into machine-readable formats. Additionally, it covers Python's features, data types, operators, and Integrated Development Environments (IDEs) like Spyder and Jupyter Notebook.

Uploaded by

diariesdoodling
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

abc

The document provides an overview of computer programming languages, detailing various types such as procedural, object-oriented, and scripting languages, along with popular examples like Python and JavaScript. It explains the role of translators, including compilers, assemblers, and interpreters, in converting source code into machine-readable formats. Additionally, it covers Python's features, data types, operators, and Integrated Development Environments (IDEs) like Spyder and Jupyter Notebook.

Uploaded by

diariesdoodling
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Unit I

What is Computer Programming Language?

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 types of programming languages include:

• Procedural: Follows a sequence of statements or commands to achieve a desired output

• Object-oriented: Helps manage complexity in large programs by packaging data and


operations into objects

• Scripting: Allows programmers to implement complex features on web pages

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.

Some related careers include:

• Data scientist

• Data analyst

• Machine learning engineer

• Full stack developer

• Project manager

• Product manager

• Data engineer

• Digital marketing specialist

• Cybersecurity analyst

here are several types of programming languages, including:


• Machine language

The lowest-level programming language, which is made up of bits and is easier for computers to
understand than programmers

• Procedural programming language

A language that follows a sequence of statements or commands to achieve a desired


output. Examples include C, C++, Java, and Pascal

• Functional programming language

A language that uses stored data to perform recursive functions. Examples include Agda, Cuneiform,
PureScript, and APL

• Object-oriented programming language

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.

Some popular programming languages include:

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.

Example: Perl, Python and Matlab.


What is Python?
Python is a general-purpose programming language that is used to create software and websites,
analyze data, and automate tasks. It is an interpreted, object-oriented, and high-level language
Features of Python
• Easy to learn: Python has a simple syntax and is easy to use.

• 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.

• Object-oriented: Python is an object-oriented programming language.

• Portable: Python is a highly portable language.

• Large standard library: Python has a large standard library.

• Interpreted: Python is an interpreted programming language, so you can


run the same code on multiple platforms without recompiling.

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

IDEs combine common developer tools into a single application with a


graphical user interface (GUI). They typically include features like a source
code editor, compiler or interpreter, debugger, syntax highlighting, code
completion, and version control integration.
What is Python Spyder IDE?

1. Spyder is an open-source cross-platform IDE. The Python Spyder IDE is written


completely in Python. It is designed by scientists and is exclusively for
scientists, data analysts, and engineers. It is also known as the Scientific
Python Development IDE and has a huge set of remarkable features which are
discussed below.
2. PyCharm is an integrated development environment (IDE) for Python that
provides a variety of tools for writing Python code, including:

• Code analysis
• Graphical debugger

• Smart code editor

• Fast navigation and search

• Autocompletion

• Error and redundancy detection and suggestions

3. A Jupyter Notebook is a web-based application that allows users to create


and share interactive documents that contain code, text, data visualizations,
and other resources:

• Features

Jupyter Notebooks support over 40 programming languages, including


Python, R, Julia, and Scala. They can be used for a variety of data science
tasks, such as exploratory data analysis, data cleaning, and machine
learning.

• 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:

Numeric int, float, complex


Types:

Sequence list, tuple, range


Types:

Mapping Dict
Type:

Set set, frozenset


Types:

Boolean Bool
Type:

Binary bytes, bytearray, memoryview


Types:
1.) Integer :- Int, or integer, is a whole number, positive or negative, without decimals, of
unlimited length.

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

Operators are used to perform operations on variables and values.

Types of Operators in Python

1. Arithmetic Operators
2. Comparison Operators
3. Logical Operators
4. Assignment Operators

Python Arithmetic Operators

Arithmetic operators are used with numeric values to perform common mathematical
operations:

Operator Name Example

+ Addition x+y

- Subtraction x-y

* Multiplication x*y

/ Division x/y

% Modulus x%y
** Exponentiation x ** y

Python Assignment Operators

Assignment operators are used to assign values to variables:

Operator Example Same As

= 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:

Operator Name Example

== Equal x == y

!= Not equal x != y

> Greater than x>y

< Less than x<y

>= Greater than or equal to x >= y

<= Less than or equal to x <= y

Python Logical Operators


Logical operators are used to combine conditional statements:

Operator Description Example

and Returns True if both statements are true x < 5 and x < 10

or Returns True if one of the statements is true x < 5 or x < 4

You might also like