












































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!













































Program is a set of instructions, written in computer Language, to perform a specific task. Or A set of instructions that directs a computer's hardware to perform a task is called a program. To solve a problem one has to write step by step solution using simple instruction. Procedure for solving a problem:- It is the process involving basic sequential step to arrive at the solution of given problem. There are basic 6 steps to solve a problem:-
A computer program consists of code that is executed on a computer to perform particular tasks. This code is written by programmers.
The programmer writes a sequence of instruction called program Types of computer languages
Set of instruction codes , which are directly understood by computer. First-generation language is the lowest level computer language. Information is conveyed to the computer by the programmer as binary instructions Low level languages are the machine codes in which the instructions are Low level languages are the machine codes in which the instructions are given in machine language in the form of 0 and 1 to a Computer system.
Assembly Language is the second generation programming language Language which involves letters, symbols and mnemonics for the execution the operation code. Eg ADD, SUB,CMP (mnemonics). Eg. ADD B STORE C TYPE HALt The programs that have been written using words, names and symbols in assembly language are converted to machine language using an Assembler.Because a Computer only understands machine code languages.
The high level languages are the most used and also more considered programming languages that helps a programmer to read, write and maintain. It is also the third generation language that is used and also running till now by many programmers. The translator may be an interpreter and Compiler that helps to convert into binary code for a Computer to understand. It is user-friendly as the programs are written in English using words, symbols,characters, numbers that needs to be converted to machine code for processing
When a program is written in a language other than machine language is not understood by any computer. So a program written in other language need to be translated into machine language before it is executed. This translation is done with the help of software called assembler
It is a program to translate the high level language program onto machine language. It occupies less memory space. But it is slower then complier. Interpreter converts the high-level program into an intermediate language. which can be executed immediately. And this all is done line by line or statement by statement. some examples are Ruby, Python, PHP and many more
A compiler is a program that translates computer code written in a high-level programming language into low-level programming language code which can be immediately executable by a computer or another similar program. this all is done whole program.
Syntax errors occur in the programs when the rules or syntax of the programming language is not followed this errors occur with incorrect punctuation, word sequence or misuse of terms. This can caused either by opening brackets without closing them.
A=b*c But has been written as A=b+c 2. mistake of <(less then),(> greater then) symbol.
Python is easy, simple and highly flexible. Python is a powerful high-level , interpreted, interactive and objectoriented-scripting language. It was designed to be easily readable; it uses English keywords frequently whereas other language use punctuation. It is a high level programming language developed by Guido van Rossum in 1991 at National Research Institute for Mathematics,Netherlands. It is presently owned by Python software Foundation (PSF
Language because Python code is executed line by line at a time. like other languages C, C++,Java, etc. there is no need to compile python code this makes it easier to debug our code. The source code of python is converted into an immediate form called byte code.
language that can model the real world is said to be object-oriented. It focuses on objects and combines data and functions. Python supports both procedure- oriented and objectoriented programming which is one of the key python features.
actually work at a python prompt and interact with the interpreter directly to execute your programs and get the output.
greater language for beginner programmers as the language is interpreted. It also supports the development of a wide range of applications, forms simple text processing to WWW(World Wide Web) browser to games
install python, you need not download and install additional libraries. All types of required functionalities are available through various modules.
used for web development(server-side), software development. The popular YouTube video sharing service is largely written in python. Today python has become language of choice for data scientists. Python is also used to development Android apps.
At the time of designing a language, some words are reserved to do specific tasks. Such words called keywords or reserved words. They are used to defined the syntax and structure of the python language. ne break except in raise False await else import pass and continue for lambda try True class finally is return as def from nonlocal while async elif if not with assert del global or yield Keyword cannot be used as a variable name. All keyword are small letters except (False, None, and True) To display the list of keyword in python we used: >>>import keyword >>>print(keyword.kwlist
Eg:- a=7 #integer literal b=2.25 #float literal c=3.14*j #complex literal.
denote Boolean values. They contain either True or False Eg:- Isboolean=True # Boolean literal. ariable
Variables are reserved memory locations to store values. This means that when you create a variable
Based on the data type of a variable, the interpreter allocates memory and decides what can be stored in the reserved memory. Therefore, by assigning
different data types to variables, you can store integers, decimals or characters in these variables. Eg >>>x= >>>x* 10
python allows you to assign a single value to several variables simultaneously. For example – a = b = c = 1 a,b,c = 1,2,“pooja“ Here, two integer objects with values 1 and 2 are assigned to variables a and b respectively, and one string object with the value "john" is assigned to the variable c.
Data types are the classification or categorization of data items. It represents the kind of value that tells what operations can be performed on a particular data
Integers – This value is represented by int class. It contains positive ornegative whole numbers (without