What Is Program and Programming Language?
What Is Program and Programming Language?
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.
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.
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.