Professional Documents
Culture Documents
Ca - Q and A
Ca - Q and A
Ca - Q and A
ii)Logic error happens as the programming happens. It runs the programming but doesn’t run as it is
expected.
Ans-
Interpreter Compiler
Scans the entire program and translates it as a
Translates program one statement at a time.
whole into machine code.
Interpreters usually take less amount of time to Compilers usually take a large amount of time to
analyse the source code. However, the overall analyse the source code. However, the overall
execution time is comparatively slower than execution time is comparatively faster than
compilers. interpreters.
No Object Code is generated, hence are memory Generates Object Code which further requires
efficient. linking, hence requires more memory.
Programming languages like JavaScript, Python, Programming languages like C, C++, Java use
Ruby use interpreters. compilers.
Ans-
A hardware architecture is primarily concerned with the internal electrical (and, more
rarely, the mechanical) interfaces among the system's components or subsystems, and the
interface between the system and its external environment, especially the devices
operated by or the electronic displays viewed by a user.
Ans-
The try and except block in Python is used to catch and handle exceptions. Python
executes code following the try statement as a “normal” part of the program. The code that
follows the except statement is the program's response to any exceptions in the preceding
try clause.
Ans-
Built-in functions are pre-defined in the programming language’s library, for the
programming to directly call the functions wherever required in the program for
achieving certain functional operations. Example-Boolean, Float, Integer.
Ans-
Reducing duplication of code.
•Decomposing complex problems into simpler pieces.
•Improving clarity of the code.
•Reuse of code.
•Information hiding.
8)What are break and continue statement used for in python?
Ans-
In Python, break and continue statements can alter the flow of a normal loop. Loops iterate
over a block of code until the test expression is false, but sometimes we wish to terminate
the current iteration or even the whole loop without checking test expression.
The break statement terminates the loop containing it. Control of the program flows to
the statement immediately after the body of the loop.
If the break statement is inside a nested loop (loop inside another loop),
the break statement will terminate the innermost loop.
The continue statement is used to skip the rest of the code inside a loop for the current
iteration only. Loop does not terminate but continues on with the next iteration.