0% found this document useful (0 votes)
168 views7 pages

What Is Program and Programming Language?

The document provides an overview of programming concepts, focusing on Python as a high-level programming language. It covers topics such as source code, interpreters, execution modes, data types, and operators, explaining their roles and functionalities in Python programming. Additionally, it discusses Python keywords, identifiers, variables, comments, and various data structures like lists, tuples, sets, and dictionaries.
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)
168 views7 pages

What Is Program and Programming Language?

The document provides an overview of programming concepts, focusing on Python as a high-level programming language. It covers topics such as source code, interpreters, execution modes, data types, and operators, explaining their roles and functionalities in Python programming. Additionally, it discusses Python keywords, identifiers, variables, comments, and various data structures like lists, tuples, sets, and dictionaries.
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/ 7

1.What is program and programming language?

• Another set of instructions to be executed by a computer to carry out a specific task


is called a program.
• language used to specify these set of instructions to the computer is called a
program language.

2.Write a note on Python


• As we know that computers understand the language of 1s and 0d which is called a
machine language.
• However it is difficult for human beings to write instruction in 1s and 0s.
• This led to the advent of eye level programming languages like Python C++, Java That
are easier to manage by humans and not directly understood by computer.

3.What is source code?


• a program written in a high level language.
• language translators like compliers and interpreters are needed to translate source
code into machine language.
• A complier translates entire source code, as a whole into the object code.

4. write about interpreter?


• Python uses An interpreter to converted its instructions into machine language, so
that it can be understood by the computer.
• An interpreter processes the program statements 1 by 1, first it translates and then
executes.
• this process is continued until the whole program is executed successfully Without
any error.

5.What are the features of Python?


• Python is a high level language. It is a free and open source language.
• it is an interpreted language, as Python programs are executed by an interpreter.
• Easy to understand as they have clearly defined the syntax and relatively simple
structure.
• Python is case sensitive.
• Python has a rich library of predefined functions.
• Python is easy to read and learn.

6.What is working of Python?


• To write and execute a Python program, we have to install a Python interpreter on
our computer or we can use the online interpreter.
• The interpreter is also called a Python shell.
• the Symbol >>> is the Python prompt, Which indicates that the interpret take
instructions.
• We can type commands or statements on this prompt to execute them using Python
interpreter.

7.what is execution mode in Python?


There are two ways to execute a Python program.
• Interactive mode
• Script mode.
Interactive mode.
• In programming, interactive mode allows you to execute code one line at a time and
see the results immediately.
• This is useful for testing and debugging small code snippets.
• Working in a interactive model is convenient for testing a single line code for instant
execution.
• but in interactive mode we cannot save the statements for future use.
• As soon as we press enter the interpreter execute the statement and display the
result.
Script mode.
• We can write a Python program in a file called Python source code, After saving it
we can use interpreter to execute it.
• Python scripts are saved as files with the file name as extension .py.
• By default, the Python scripts are saved in the Python installation folder.
• to execute a script we can either type the name along with the path at the prompt.

Execution: The entire script is executed from top to bottom when you run the file.
Persistence: The code is saved in a file, so you can run it multiple times without retyping it.
Complexity: It’s suitable for more complex programs that require multiple lines of code
and functions.
Debugging: Errors are reported after the entire script is run, which can make debugging a
bit more challenging compared to interactive mode.

8.What are Python keywords?


• Python keywords are reserved words.
• Each keyword has a special meaning and cannot be used as identifiers (like variable
names, function names, etc.).
• They are fundamental to the syntax and structure of Python programs.
• Has Python is case sensitive keywords must be written exactly.
• Each keyword serves a specific purpose and helps in writing clear and efficient
code.

9.What is identifiers ?
• In programming languages identifiers are names used to identify a variable function
or other entities in a program.
• Identifiers must follow specific naming rules defined by the programming language.
• Typically, they must start with a letter (uppercase or lowercase) .
• Identifiers are often case-sensitive.
• Identifiers cannot be the same as reserved words or keywords predefined by the
programming language .
• Good programming practice dictates that identifiers should be meaningful and
descriptive, reflecting the purpose .

10.What is variables?
• Variable in a program is uniquely identified by a (identifier).
• Variable in Python refers to an object or element that is stored in a memory.
• Value of a variable can be a String Numeric combination of alpha numeric
characters..
• In Python we can use an assignment statement to create a new variable and assign
specific value to them.

11.What is comments?
• Comments are used to add a remark or a note in the source code.
• Comments in Python are used to explain the code, make it more readable, and
prevent execution of certain lines during testing.
• Comments are not executed by the interpreter.
• They are ignored by the Python interpreter, so they don’t affect the program’s
output.
• Comments start with the hash symbol (#) and extend to the end of the line. They are
often used for brief explanations or notes.

12.What is data types?


• Every value belonged to a specific data type in Python.
• That it identifies the type of data value the variable can hold and operation that can
be performed on the data.
1. Numbers.
2. Sequence.
3. Set.
4. None.
5. Mapping.

13.What is number data type?


• The number data type is used to store numeric values.
• Integers (int): These are whole numbers, both positive and negative, without any
decimal point. For example, 5, -10, and 1000 are integers.
• Floating-Point Numbers (float): These are numbers that contain a decimal point.
They can represent fractional values. For example, 3.14, -0.001, and 2.0 are floating-
point numbers.
• Complex Numbers (complex): These are numbers with a real and an imaginary
part, represented as a + bj, where a is the real part and b is the imaginary part. For
example, 1 + 2j and 3 – 4j are complex numbers.
• Boolean data type: it is a sub type of integers it consists true or false.

14.What is sequence?
• In Python, a sequence is an ordered collection of items or elements.
• Sequences are one of the fundamental data types and provide a way to organize
and work with data in a specific order.
1. String.
2. List.
3. Tuples.

15.What is string?
• A string is a sequence of they may be alphabets digits or special characters
including spaces tin values are enclosed hey the single quotes or double quotes.
• Strings are used to represent text data and are immutable, meaning once created,
their content cannot be changed.
• The ports are not a part of a string but they are used to mark beginning and end of a
string.
16. what are list?
• List is a sequence of items separated by commas.
• The heightens are enclosed in square brackets[].

17.What is tuples?
• Tuple is a sequence of items separated by commas and items are enclosed by ( )
parentheses,
• This is unlike list where the values are enclosed in square brackets once created
cannot be changed in tuples.

18.what is set?
• set is an unordered collection of items separated by commas.
• Items are enclosed by curly brackets { } .
• A set is similar to a list.
• But it cannot have duplicate entries so once created cannot be changed.

19.What is None?
• None is a special data type with a single value.
• It is used to signify the absence of a value in a situation.
• none supports no special operation.
• It is neither false nor 0.

20.What is mapping?
• It is an unordered data type in Python currently there is one standard mapping in
data type is called a dictionary.

21.what is dictionary?
• Dictionary in Python hold data item in key value pairs.
• item in a dictionary are enclosed in curly brackets.
• dictionary permit faster access to data every key is separated from its value using a
: colon sign.
• The key are usually string and their value can be any data type.
• In order to access any value in dictionary we have to specify its key in square
brackets.

22. Deciding the usage of Python data types.


• Hello it is prepared to use list when we need a simple collection of data that may go
for frequent modification.
23. what are Operators?
• An operator is used to perform specific mathematic or logical operation on values.
• the values that the operator works on are called operands.

24. what are arithmetic operations?


• Patient reports arithmetic operators that are used to perform a four basic arithmetic
operations as well as modular division ,floor division and exponent .
25.What is rational operators?
• Relational operators are used in programming to compare two values or
expressions. They help determine the relationship between these values, returning a
boolean result (true or false).

26.what is logical operations?


• Logical operations are used in programming to perform logical reasoning and
decision-making based on boolean values (true or false).
• These operators are essential for controlling the flow of a program, making
decisions, and evaluating conditions.
• They are widely used in conditional statements, loops, and various logical
expressions.

27.what is Assignment operator?


• Assignment operators are used in programming to assign values to variables.
• They allow you to store and update data within a program.

28.What are logical operators?


• there are three logical operators supported by python these operators (and, or ,not)
how to be written in global case only.
• The logical operator evaluation to either true or false the based on the logical
operands on the either side.
• Every value logically true or false by default, all values are through accept
• None, false, 0, empty
Collection “” ,(),[],{}..

You might also like